3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Bar { public function foo() { return 1; } public function get() { return function() { return $this->foo() === static::foo(); }; } } class Baz { public function foo() { return 2; } public function exec(callable $closure) { return $closure(); } } $bar = new Bar; $baz = new Baz; var_dump($baz->exec($bar->get()));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3PseK
function name:  (null)
number of ops:  15
compiled vars:  !0 = $bar, !1 = $baz
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   NEW                                              $2      'Bar'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   32     3        NEW                                              $5      'Baz'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $5
   34     6        INIT_FCALL                                               'var_dump'
          7        INIT_METHOD_CALL                                         !1, 'exec'
          8        INIT_METHOD_CALL                                         !0, 'get'
          9        DO_FCALL                                      0  $8      
         10        SEND_VAR_NO_REF_EX                                       $8
         11        DO_FCALL                                      0  $9      
         12        SEND_VAR                                                 $9
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F3PseK%3A12%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3PseK
function name:  {closure}
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   FETCH_THIS                                       $0      
          1        INIT_METHOD_CALL                                         $0, 'foo'
          2        DO_FCALL                                      0  $1      
          3        INIT_STATIC_METHOD_CALL                                  'foo'
          4        DO_FCALL                                      0  $2      
          5        IS_IDENTICAL                                     ~3      $1, $2
          6      > RETURN                                                   ~3
   14     7*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F3PseK%3A12%240

Class Bar:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3PseK
function name:  foo
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E > > RETURN                                                   1
    8     1*     > RETURN                                                   null

End of function foo

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

End of function get

End of class Bar.

Class Baz:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3PseK
function name:  foo
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E > > RETURN                                                   2
   23     1*     > RETURN                                                   null

End of function foo

Function exec:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3PseK
function name:  exec
number of ops:  5
compiled vars:  !0 = $closure
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   RECV                                             !0      
   27     1        INIT_DYNAMIC_CALL                                        !0
          2        DO_FCALL                                      0  $1      
          3      > RETURN                                                   $1
   28     4*     > RETURN                                                   null

End of function exec

End of class Baz.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.44 ms | 1400 KiB | 15 Q