3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Sorter { public static function sort($a, $b) { return $a - $b; } } spl_autoload_register(function($class) { echo "autoloading {$class}\n"; eval("class $class extends Sorter { }"); }); $array = array(3, 1, 4, 1, 5, 9, 2, 6, 5, 4); usort($array, array("Foo", "sort")); print_r($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LrLKV
function name:  (null)
number of ops:  13
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'spl_autoload_register'
          1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FLrLKV%3A7%240'
   10     2        SEND_VAL                                                 ~1
          3        DO_ICALL                                                 
   12     4        ASSIGN                                                   !0, <array>
   13     5        INIT_FCALL                                               'usort'
          6        SEND_REF                                                 !0
          7        SEND_VAL                                                 <array>
          8        DO_ICALL                                                 
   14     9        INIT_FCALL                                               'print_r'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FLrLKV%3A7%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LrLKV
function name:  {closure}
number of ops:  10
compiled vars:  !0 = $class
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        ROPE_INIT                                     3  ~2      'autoloading+'
          2        ROPE_ADD                                      1  ~2      ~2, !0
          3        ROPE_END                                      2  ~1      ~2, '%0A'
          4        ECHO                                                     ~1
    9     5        ROPE_INIT                                     3  ~5      'class+'
          6        ROPE_ADD                                      1  ~5      ~5, !0
          7        ROPE_END                                      2  ~4      ~5, '+extends+Sorter+%7B+%7D'
          8        INCLUDE_OR_EVAL                                          ~4, EVAL
   10     9      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FLrLKV%3A7%240

Class Sorter:
Function sort:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LrLKV
function name:  sort
number of ops:  5
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        SUB                                              ~2      !0, !1
          3      > RETURN                                                   ~2
          4*     > RETURN                                                   null

End of function sort

End of class Sorter.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.15 ms | 1396 KiB | 19 Q