3v4l.org

run code in 300+ PHP versions simultaneously
<?php class C { public $ello = 'ello'; public $c; public $m; function __construct($y){ $this->c = static function($f){ return $f().$this->ello; }; $this->m = function(){ return "h"; }; } } $x = new C("h"); $f = $x->c; echo $f($x->m);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hjeAa
function name:  (null)
number of ops:  13
compiled vars:  !0 = $x, !1 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $2      'C'
          1        SEND_VAL_EX                                              'h'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   19     4        FETCH_OBJ_R                                      ~5      !0, 'c'
          5        ASSIGN                                                   !1, ~5
   20     6        INIT_DYNAMIC_CALL                                        !1
          7        CHECK_FUNC_ARG                                           
          8        FETCH_OBJ_FUNC_ARG                               $7      !0, 'm'
          9        SEND_FUNC_ARG                                            $7
         10        DO_FCALL                                      0  $8      
         11        ECHO                                                     $8
         12      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FhjeAa%3A8%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hjeAa
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     1        INIT_DYNAMIC_CALL                                        !0
          2        DO_FCALL                                      0  $1      
          3        FETCH_THIS                                       $2      
          4        FETCH_OBJ_R                                      ~3      $2, 'ello'
          5        CONCAT                                           ~4      $1, ~3
          6      > RETURN                                                   ~4
   10     7*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FhjeAa%3A8%240

Function %00%7Bclosure%7D%2Fin%2FhjeAa%3A12%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hjeAa
function name:  {closure}
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E > > RETURN                                                   'h'
   14     1*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FhjeAa%3A12%241

Class C:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hjeAa
function name:  __construct
number of ops:  8
compiled vars:  !0 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FhjeAa%3A8%240'
          2        ASSIGN_OBJ                                               'c'
   10     3        OP_DATA                                                  ~2
   12     4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FhjeAa%3A12%241'
          5        ASSIGN_OBJ                                               'm'
   14     6        OP_DATA                                                  ~4
   15     7      > RETURN                                                   null

End of function __construct

End of class C.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.19 ms | 1390 KiB | 13 Q