3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyClass { public $prop1 = "I'm a class property!"; public function get() { $a = 'chau'; $b = 'hola'; $f = function () use ($a) { return function ($p) { return $p.$a; }; }; $g = $f(); return $g($b); } } $obj = new MyClass; echo $obj->get();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CSWBf
function name:  (null)
number of ops:  7
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   NEW                                              $1      'MyClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   29     3        INIT_METHOD_CALL                                         !0, 'get'
          4        DO_FCALL                                      0  $4      
          5        ECHO                                                     $4
          6      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FCSWBf%3A13%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CSWBf
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   BIND_STATIC                                              !0
   15     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FCSWBf%3A15%241'
   18     2      > RETURN                                                   ~1
   19     3*     > RETURN                                                   null

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

Function %00%7Bclosure%7D%2Fin%2FCSWBf%3A15%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CSWBf
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $p, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   17     1        CONCAT                                           ~2      !0, !1
          2      > RETURN                                                   ~2
   18     3*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FCSWBf%3A15%241

Class MyClass:
Function get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CSWBf
function name:  get
number of ops:  13
compiled vars:  !0 = $a, !1 = $b, !2 = $f, !3 = $g
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   ASSIGN                                                   !0, 'chau'
   11     1        ASSIGN                                                   !1, 'hola'
   13     2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FCSWBf%3A13%240'
          3        BIND_LEXICAL                                             ~6, !0
          4        ASSIGN                                                   !2, ~6
   21     5        INIT_DYNAMIC_CALL                                        !2
          6        DO_FCALL                                      0  $8      
          7        ASSIGN                                                   !3, $8
   23     8        INIT_DYNAMIC_CALL                                        !3
          9        SEND_VAR_EX                                              !1
         10        DO_FCALL                                      0  $10     
         11      > RETURN                                                   $10
   24    12*     > RETURN                                                   null

End of function get

End of class MyClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.48 ms | 1390 KiB | 13 Q