3v4l.org

run code in 300+ PHP versions simultaneously
<?php class T { public function __construct($v) { $this->v = $v; } public function __toString() { return 'a'; } } $list = [new T(1), new T(2)]; usort($list, function($a, $b) { return strcmp($a, $b); }); // PHP reverses $list but HHVM doesn't touch it print_r($list);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EG0F2
function name:  (null)
number of ops:  19
compiled vars:  !0 = $list
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            't'
   14     1        NEW                                              $1      'T'
          2        SEND_VAL_EX                                              1
          3        DO_FCALL                                      0          
          4        INIT_ARRAY                                       ~3      $1
          5        NEW                                              $4      'T'
          6        SEND_VAL_EX                                              2
          7        DO_FCALL                                      0          
          8        ADD_ARRAY_ELEMENT                                ~3      $4
          9        ASSIGN                                                   !0, ~3
   16    10        INIT_FCALL                                               'usort'
         11        SEND_REF                                                 !0
         12        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FEG0F2%3A16%241'
   18    13        SEND_VAL                                                 ~7
         14        DO_ICALL                                                 
   21    15        INIT_FCALL                                               'print_r'
         16        SEND_VAR                                                 !0
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FEG0F2%3A16%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EG0F2
function name:  {closure}
number of ops:  8
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        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $2      
          6      > RETURN                                                   $2
   18     7*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FEG0F2%3A16%241

Class T:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EG0F2
function name:  __construct
number of ops:  4
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    6     1        ASSIGN_OBJ                                               'v'
          2        OP_DATA                                                  !0
    7     3      > RETURN                                                   null

End of function __construct

Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EG0F2
function name:  __toString
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E > > RETURN                                                   'a'
   11     1*       VERIFY_RETURN_TYPE                                       
          2*     > RETURN                                                   null

End of function __tostring

End of class T.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.6 ms | 1392 KiB | 19 Q