3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array('a', 'b', 'c', 'd'); usort($array, 'some_sort_function'); function some_sort_function($a, $b) { static $foo = NULL; if ($foo === NULL) { $foo = 'bar'; echo "just once?\n"; } return 0; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9aOKF
function name:  (null)
number of ops:  6
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        INIT_FCALL                                               'usort'
          2        SEND_REF                                                 !0
          3        SEND_VAL                                                 'some_sort_function'
          4        DO_ICALL                                                 
   15     5      > RETURN                                                   1

Function some_sort_function:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/9aOKF
function name:  some_sort_function
number of ops:  9
compiled vars:  !0 = $a, !1 = $b, !2 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    7     2        BIND_STATIC                                              !2
    9     3        TYPE_CHECK                                    2          !2
          4      > JMPZ                                                     ~3, ->7
   10     5    >   ASSIGN                                                   !2, 'bar'
   11     6        ECHO                                                     'just+once%3F%0A'
   14     7    > > RETURN                                                   0
   15     8*     > RETURN                                                   null

End of function some_sort_function

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.88 ms | 1395 KiB | 15 Q