3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ar = Array ( 0 => Array ( 'name' => "The 5th Wave", 'releaseDate' => '2016-01-22', 'dates' => Array ( 'date' => Array ( 0 => '2016-01-27', 1 => '2016-01-26' ) ) ), 1 => Array ( 'name' => 'Dirty Grandpa', 'releaseDate' => '2016-01-21', 'dates' => Array ( 'date' => Array ( 0 => '2016-01-27', 1 => '2016-01-26' ) ) ), 2 => Array ( 'name' => 'The Revenant', 'releaseDate' => '2016-01-14', 'dates' => Array ( 'date' => Array ( 0 => '2016-01-27', 1 => '2016-01-26' ) ) ) ); print_r($ar); echo "================Sort============="; $uasort($ar, function($a, $b){ if( end($array['dates']['date']) < $array['releaseDate'] OR end($a['dates']['date']) > date("Y-m-d", strtotime('next thursday')) ){ return -1; } else{ return 0; } }); print_r($ar);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WcbXT
function name:  (null)
number of ops:  14
compiled vars:  !0 = $ar, !1 = $uasort
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   50     1        INIT_FCALL                                               'print_r'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
   52     4        ECHO                                                     '%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3DSort%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D'
   54     5        INIT_DYNAMIC_CALL                                        !1
          6        SEND_VAR_EX                                              !0
          7        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FWcbXT%3A54%240'
   63     8        SEND_VAL_EX                                              ~4
          9        DO_FCALL                                      0          
   65    10        INIT_FCALL                                               'print_r'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FWcbXT%3A54%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 10, Position 2 = 24
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 27
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/WcbXT
function name:  {closure}
number of ops:  29
compiled vars:  !0 = $a, !1 = $b, !2 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   54     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   55     2        INIT_FCALL                                               'end'
          3        FETCH_DIM_W                                      $3      !2, 'dates'
          4        FETCH_DIM_W                                      $4      $3, 'date'
          5        SEND_REF                                                 $4
          6        DO_ICALL                                         $5      
          7        FETCH_DIM_R                                      ~6      !2, 'releaseDate'
          8        IS_SMALLER                                       ~7      $5, ~6
          9      > JMPNZ_EX                                         ~7      ~7, ->24
   56    10    >   INIT_FCALL                                               'end'
         11        FETCH_DIM_W                                      $8      !0, 'dates'
         12        FETCH_DIM_W                                      $9      $8, 'date'
         13        SEND_REF                                                 $9
         14        DO_ICALL                                         $10     
         15        INIT_FCALL                                               'date'
         16        SEND_VAL                                                 'Y-m-d'
         17        INIT_FCALL                                               'strtotime'
         18        SEND_VAL                                                 'next+thursday'
         19        DO_ICALL                                         $11     
         20        SEND_VAR                                                 $11
         21        DO_ICALL                                         $12     
         22        IS_SMALLER                                       ~13     $12, $10
         23        BOOL                                             ~7      ~13
         24    > > JMPZ                                                     ~7, ->27
   58    25    > > RETURN                                                   -1
         26*       JMP                                                      ->28
   61    27    > > RETURN                                                   0
   63    28*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FWcbXT%3A54%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.73 ms | 1400 KiB | 21 Q