3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array( array('apn' => 345345345, 'sqft' => 1200, 'address' => '323 Pacific Ave.'), array('apn' => 345345342, 'sqft' => 1421, 'address' => '324 Pacific Ave.'), array('apn' => 345345346, 'sqft' => 1012, 'address' => '325 Pacific Ave.'), array('apn' => 345345347, 'sqft' => 1093, 'address' => '328 Pacific Ave.'), array('apn' => 345345353, 'sqft' => 1121, 'address' => '12 Lincoln Ave.'), array('apn' => 345345351, 'sqft' => 1643, 'address' => '13 Lincoln Ave.'), array('apn' => 345345352, 'sqft' => 1222, 'address' => '14 Lincoln Ave.') ); usort($array, function($x, $y) { $x = preg_split('/^(\d+)\s+(.*)/', $x['address'], -1 , 3); $y = preg_split('/^(\d+)\s+(.*)/', $y['address'], -1 , 3); $x[2] = $x[0] % 2; $y[2] = $y[0] % 2; if($x[1]==$y[1]) { if($x[2]==$y[2]) return $x[0]<$y[0]?-1:$x[0]!=$y[0]; return $x[2]>$y[2]?:1; } return $x[1]<$y[1]?:1; }); var_dump($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/K9Uoh
function name:  (null)
number of ops:  10
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   12     1        INIT_FCALL                                               'usort'
          2        SEND_REF                                                 !0
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FK9Uoh%3A12%240'
   25     4        SEND_VAL                                                 ~2
          5        DO_ICALL                                                 
   28     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FK9Uoh%3A12%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 51
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 34, Position 2 = 45
Branch analysis from position: 34
2 jumps found. (Code = 43) Position 1 = 38, Position 2 = 40
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 44
Branch analysis from position: 44
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 45
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 51
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/K9Uoh
function name:  {closure}
number of ops:  58
compiled vars:  !0 = $x, !1 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   14     2        INIT_FCALL                                               'preg_split'
          3        SEND_VAL                                                 '%2F%5E%28%5Cd%2B%29%5Cs%2B%28.%2A%29%2F'
          4        FETCH_DIM_R                                      ~2      !0, 'address'
          5        SEND_VAL                                                 ~2
          6        SEND_VAL                                                 -1
          7        SEND_VAL                                                 3
          8        DO_ICALL                                         $3      
          9        ASSIGN                                                   !0, $3
   15    10        INIT_FCALL                                               'preg_split'
         11        SEND_VAL                                                 '%2F%5E%28%5Cd%2B%29%5Cs%2B%28.%2A%29%2F'
         12        FETCH_DIM_R                                      ~5      !1, 'address'
         13        SEND_VAL                                                 ~5
         14        SEND_VAL                                                 -1
         15        SEND_VAL                                                 3
         16        DO_ICALL                                         $6      
         17        ASSIGN                                                   !1, $6
   16    18        FETCH_DIM_R                                      ~9      !0, 0
         19        MOD                                              ~10     ~9, 2
         20        ASSIGN_DIM                                               !0, 2
         21        OP_DATA                                                  ~10
   17    22        FETCH_DIM_R                                      ~12     !1, 0
         23        MOD                                              ~13     ~12, 2
         24        ASSIGN_DIM                                               !1, 2
         25        OP_DATA                                                  ~13
   18    26        FETCH_DIM_R                                      ~14     !0, 1
         27        FETCH_DIM_R                                      ~15     !1, 1
         28        IS_EQUAL                                                 ~14, ~15
         29      > JMPZ                                                     ~16, ->51
   20    30    >   FETCH_DIM_R                                      ~17     !0, 2
         31        FETCH_DIM_R                                      ~18     !1, 2
         32        IS_EQUAL                                                 ~17, ~18
         33      > JMPZ                                                     ~19, ->45
   21    34    >   FETCH_DIM_R                                      ~20     !0, 0
         35        FETCH_DIM_R                                      ~21     !1, 0
         36        IS_SMALLER                                               ~20, ~21
         37      > JMPZ                                                     ~22, ->40
         38    >   QM_ASSIGN                                        ~23     -1
         39      > JMP                                                      ->44
         40    >   FETCH_DIM_R                                      ~24     !0, 0
         41        FETCH_DIM_R                                      ~25     !1, 0
         42        IS_NOT_EQUAL                                     ~26     ~24, ~25
         43        QM_ASSIGN                                        ~23     ~26
         44    > > RETURN                                                   ~23
   22    45    >   FETCH_DIM_R                                      ~27     !0, 2
         46        FETCH_DIM_R                                      ~28     !1, 2
         47        IS_SMALLER                                       ~29     ~28, ~27
         48        JMP_SET                                          ~30     ~29, ->50
         49        QM_ASSIGN                                        ~30     1
         50      > RETURN                                                   ~30
   24    51    >   FETCH_DIM_R                                      ~31     !0, 1
         52        FETCH_DIM_R                                      ~32     !1, 1
         53        IS_SMALLER                                       ~33     ~31, ~32
         54        JMP_SET                                          ~34     ~33, ->56
         55        QM_ASSIGN                                        ~34     1
         56      > RETURN                                                   ~34
   25    57*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FK9Uoh%3A12%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
185.76 ms | 1400 KiB | 19 Q