3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public $name; } $test1 = new Test(); $test1 -> name = "Футбол"; $test2 = new Test(); $test2 -> name = "Баскетбол"; $arr = array(); $arr[] = $test1; $arr[] = $test2; var_dump($arr); usort($arr, function ($a,$b) { $al = strtolower($a->name); $bl = strtolower($b->name); if($al[0] < $bl[0]) return -1; elseif($al[0] > $bl[0]) return 1; else return 0; }); var_dump($arr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lBD4q
function name:  (null)
number of ops:  27
compiled vars:  !0 = $test1, !1 = $test2, !2 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   NEW                                              $3      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
    8     3        ASSIGN_OBJ                                               !0, 'name'
          4        OP_DATA                                                  '%D0%A4%D1%83%D1%82%D0%B1%D0%BE%D0%BB'
   10     5        NEW                                              $7      'Test'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $7
   11     8        ASSIGN_OBJ                                               !1, 'name'
          9        OP_DATA                                                  '%D0%91%D0%B0%D1%81%D0%BA%D0%B5%D1%82%D0%B1%D0%BE%D0%BB'
   13    10        ASSIGN                                                   !2, <array>
   14    11        ASSIGN_DIM                                               !2
         12        OP_DATA                                                  !0
   15    13        ASSIGN_DIM                                               !2
         14        OP_DATA                                                  !1
   16    15        INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !2
         17        DO_ICALL                                                 
   18    18        INIT_FCALL                                               'usort'
         19        SEND_REF                                                 !2
         20        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FlBD4q%3A18%240'
   24    21        SEND_VAL                                                 ~15
         22        DO_ICALL                                                 
   26    23        INIT_FCALL                                               'var_dump'
         24        SEND_VAR                                                 !2
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FlBD4q%3A18%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 18
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 24
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lBD4q
function name:  {closure}
number of ops:  26
compiled vars:  !0 = $a, !1 = $b, !2 = $al, !3 = $bl
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   19     2        INIT_FCALL                                               'strtolower'
          3        FETCH_OBJ_R                                      ~4      !0, 'name'
          4        SEND_VAL                                                 ~4
          5        DO_ICALL                                         $5      
          6        ASSIGN                                                   !2, $5
   20     7        INIT_FCALL                                               'strtolower'
          8        FETCH_OBJ_R                                      ~7      !1, 'name'
          9        SEND_VAL                                                 ~7
         10        DO_ICALL                                         $8      
         11        ASSIGN                                                   !3, $8
   21    12        FETCH_DIM_R                                      ~10     !2, 0
         13        FETCH_DIM_R                                      ~11     !3, 0
         14        IS_SMALLER                                               ~10, ~11
         15      > JMPZ                                                     ~12, ->18
         16    > > RETURN                                                   -1
         17*       JMP                                                      ->25
   22    18    >   FETCH_DIM_R                                      ~13     !2, 0
         19        FETCH_DIM_R                                      ~14     !3, 0
         20        IS_SMALLER                                               ~14, ~13
         21      > JMPZ                                                     ~15, ->24
         22    > > RETURN                                                   1
         23*       JMP                                                      ->25
   23    24    > > RETURN                                                   0
   24    25*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FlBD4q%3A18%240

Class Test: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.55 ms | 1400 KiB | 19 Q