3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr1 = array("foo", "ybar", "baz"); $arr2 = array("foo2", "ybar2", "baz2"); $arr3 = array("foo3", "ybar3", "baz3"); $results = array(); foreach ($arr1 as $key=>$value) { $results[] = array( 'arr1' => $value, 'arr2' => $arr2[$key], 'arr3' => $arr3[$key], ); } function sortByArr1($a, $b) { return strcmp($a['arr1'], $b['arr1']); } usort($results, "sortByArr1"); print "<pre>"; print_r($results);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 15
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 15
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/YZi8O
function name:  (null)
number of ops:  25
compiled vars:  !0 = $arr1, !1 = $arr2, !2 = $arr3, !3 = $results, !4 = $value, !5 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    5     2        ASSIGN                                                   !2, <array>
    7     3        ASSIGN                                                   !3, <array>
    8     4      > FE_RESET_R                                       $10     !0, ->15
          5    > > FE_FETCH_R                                       ~11     $10, !4, ->15
          6    >   ASSIGN                                                   !5, ~11
   10     7        INIT_ARRAY                                       ~14     !4, 'arr1'
   11     8        FETCH_DIM_R                                      ~15     !1, !5
          9        ADD_ARRAY_ELEMENT                                ~14     ~15, 'arr2'
   12    10        FETCH_DIM_R                                      ~16     !2, !5
         11        ADD_ARRAY_ELEMENT                                ~14     ~16, 'arr3'
    9    12        ASSIGN_DIM                                               !3
   12    13        OP_DATA                                                  ~14
    8    14      > JMP                                                      ->5
         15    >   FE_FREE                                                  $10
   20    16        INIT_FCALL                                               'usort'
         17        SEND_REF                                                 !3
         18        SEND_VAL                                                 'sortByArr1'
         19        DO_ICALL                                                 
   22    20        ECHO                                                     '%3Cpre%3E'
   23    21        INIT_FCALL                                               'print_r'
         22        SEND_VAR                                                 !3
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

Function sortbyarr1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YZi8O
function name:  sortByArr1
number of ops:  10
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   17     2        INIT_FCALL                                               'strcmp'
          3        FETCH_DIM_R                                      ~2      !0, 'arr1'
          4        SEND_VAL                                                 ~2
          5        FETCH_DIM_R                                      ~3      !1, 'arr1'
          6        SEND_VAL                                                 ~3
          7        DO_ICALL                                         $4      
          8      > RETURN                                                   $4
   18     9*     > RETURN                                                   null

End of function sortbyarr1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.46 ms | 1400 KiB | 19 Q