3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Foo; use Bar\B; class A { public function foo(): Closure { $b = new B(); return function() use ($b) { $b->bar(); }; } } namespace Bar; use Buzz\ImportedException; class B { public function bar() { throw new ImportedException(); } } namespace Buzz; use \Exception; class ImportedException extends Exception { } $a = new A(); $closure = $a->foo(); $closure();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/huv3k
function name:  (null)
number of ops:  9
compiled vars:  !0 = $a, !1 = $closure
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   33     0  E >   NEW                                              $2      'Buzz%5CA'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   34     3        INIT_METHOD_CALL                                         !0, 'foo'
          4        DO_FCALL                                      0  $5      
          5        ASSIGN                                                   !1, $5
   35     6        INIT_DYNAMIC_CALL                                        !1
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

Function %00foo%5C%7Bclosure%7D%2Fin%2Fhuv3k%3A9%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/huv3k
function name:  Foo\{closure}
number of ops:  4
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   BIND_STATIC                                              !0
   10     1        INIT_METHOD_CALL                                         !0, 'bar'
          2        DO_FCALL                                      0          
   11     3      > RETURN                                                   null

End of function %00foo%5C%7Bclosure%7D%2Fin%2Fhuv3k%3A9%240

Class Foo\A:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/huv3k
function name:  foo
number of ops:  9
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   NEW                                              $1      'Bar%5CB'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
    9     3        DECLARE_LAMBDA_FUNCTION                                  '%00foo%5C%7Bclosure%7D%2Fin%2Fhuv3k%3A9%240'
          4        BIND_LEXICAL                                             ~4, !0
   11     5        VERIFY_RETURN_TYPE                                       ~4
          6      > RETURN                                                   ~4
   12     7*       VERIFY_RETURN_TYPE                                       
          8*     > RETURN                                                   null

End of function foo

End of class Foo\A.

Class Bar\B:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/huv3k
function name:  bar
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   NEW                                              $0      'Buzz%5CImportedException'
          1        DO_FCALL                                      0          
          2      > THROW                                         0          $0
   23     3*     > RETURN                                                   null

End of function bar

End of class Bar\B.

Class Buzz\ImportedException: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.36 ms | 1395 KiB | 13 Q