3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test($obj){ $c = function(){ return 'baz'; }; $obj->store = $c; } test($x = new stdclass); test($y = new stdclass); var_dump($x === $y);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/F5JRF
function name:  (null)
number of ops:  17
compiled vars:  !0 = $x, !1 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'test'
          1        NEW                                              $2      'stdclass'
          2        DO_FCALL                                      0          
          3        ASSIGN                                           ~4      !0, $2
          4        SEND_VAL                                                 ~4
          5        DO_FCALL                                      0          
    9     6        INIT_FCALL                                               'test'
          7        NEW                                              $6      'stdclass'
          8        DO_FCALL                                      0          
          9        ASSIGN                                           ~8      !1, $6
         10        SEND_VAL                                                 ~8
         11        DO_FCALL                                      0          
   11    12        INIT_FCALL                                               'var_dump'
         13        IS_IDENTICAL                                     ~10     !0, !1
         14        SEND_VAL                                                 ~10
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/F5JRF
function name:  test
number of ops:  6
compiled vars:  !0 = $obj, !1 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FF5JRF%3A4%240'
          2        ASSIGN                                                   !1, ~2
    5     3        ASSIGN_OBJ                                               !0, 'store'
          4        OP_DATA                                                  !1
    6     5      > RETURN                                                   null

End of function test

Function %00%7Bclosure%7D%2Fin%2FF5JRF%3A4%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/F5JRF
function name:  {closure}
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E > > RETURN                                                   'baz'
          1*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FF5JRF%3A4%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.12 ms | 1399 KiB | 17 Q