3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace A { class T {} } namespace { class Test { public function first(string $str) : Closure { return function() use ($str) : int { return strlen($str); }; } public function second() : self { return $this; } } class SubTest extends Test { public function third() : parent { return new Test; } } $s = new SubTest; $t = $s->third(); echo ($t->second()->first("hello"))(); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BYiRF
function name:  (null)
number of ops:  15
compiled vars:  !0 = $s, !1 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   NEW                                              $2      'SubTest'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   33     3        INIT_METHOD_CALL                                         !0, 'third'
          4        DO_FCALL                                      0  $5      
          5        ASSIGN                                                   !1, $5
   34     6        INIT_METHOD_CALL                                         !1, 'second'
          7        DO_FCALL                                      0  $7      
          8        INIT_METHOD_CALL                                         $7, 'first'
          9        SEND_VAL_EX                                              'hello'
         10        DO_FCALL                                      0  $8      
         11        INIT_DYNAMIC_CALL                                        $8
         12        DO_FCALL                                      0  $9      
         13        ECHO                                                     $9
   35    14      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FBYiRF%3A13%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BYiRF
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   BIND_STATIC                                              !0
   14     1        STRLEN                                           ~1      !0
          2        VERIFY_RETURN_TYPE                                       ~1
          3      > RETURN                                                   ~1
   15     4*       VERIFY_RETURN_TYPE                                       
          5*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FBYiRF%3A13%240

Class A\T: [no user functions]
Class Test:
Function first:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BYiRF
function name:  first
number of ops:  7
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   13     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FBYiRF%3A13%240'
          2        BIND_LEXICAL                                             ~1, !0
   15     3        VERIFY_RETURN_TYPE                                       ~1
          4      > RETURN                                                   ~1
   16     5*       VERIFY_RETURN_TYPE                                       
          6*     > RETURN                                                   null

End of function first

Function second:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BYiRF
function name:  second
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   FETCH_THIS                                       ~0      
          1        VERIFY_RETURN_TYPE                                       ~0
          2      > RETURN                                                   ~0
   21     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function second

End of class Test.

Class SubTest:
Function third:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BYiRF
function name:  third
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   NEW                                              $0      'Test'
          1        DO_FCALL                                      0          
          2        VERIFY_RETURN_TYPE                                       $0
          3      > RETURN                                                   $0
   29     4*       VERIFY_RETURN_TYPE                                       
          5*     > RETURN                                                   null

End of function third

Function first:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BYiRF
function name:  first
number of ops:  7
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   13     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FBYiRF%3A13%240'
          2        BIND_LEXICAL                                             ~1, !0
   15     3        VERIFY_RETURN_TYPE                                       ~1
          4      > RETURN                                                   ~1
   16     5*       VERIFY_RETURN_TYPE                                       
          6*     > RETURN                                                   null

End of function first

Function second:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BYiRF
function name:  second
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   FETCH_THIS                                       ~0      
          1        VERIFY_RETURN_TYPE                                       ~0
          2      > RETURN                                                   ~0
   21     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function second

End of class SubTest.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.08 ms | 1399 KiB | 13 Q