3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo() { return function() { return 'a value'; }; } var_dump(spl_object_hash(foo()) === spl_object_hash(foo())); // is it the same?
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iGQti
function name:  (null)
number of ops:  15
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'spl_object_hash'
          2        INIT_FCALL                                               'foo'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                         $1      
          6        INIT_FCALL                                               'spl_object_hash'
          7        INIT_FCALL                                               'foo'
          8        DO_FCALL                                      0  $2      
          9        SEND_VAR                                                 $2
         10        DO_ICALL                                         $3      
         11        IS_IDENTICAL                                     ~4      $1, $3
         12        SEND_VAL                                                 ~4
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

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

End of function foo

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

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.72 ms | 1402 KiB | 19 Q