3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* class myClass{ public function __construct($i){ echo $i; } } $inst = new myClass('testing'); */ $inst = new class('testing'){ private $i; public function __construct($i){ $this->$i = $i; } public function returnPrivate(){ return $this->$i; } }; echo $inst->returnPrivate();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0QEs5
function name:  (null)
number of ops:  9
compiled vars:  !0 = $inst
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   DECLARE_ANON_CLASS                               <undef> 
          1        NEW                                              $2      $1
          2        SEND_VAL_EX                                              'testing'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $2
   34     5        INIT_METHOD_CALL                                         !0, 'returnPrivate'
          6        DO_FCALL                                      0  $5      
          7        ECHO                                                     $5
          8      > RETURN                                                   1

Class class@anonymous:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0QEs5
function name:  __construct
number of ops:  4
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
   22     1        ASSIGN_OBJ                                               !0
          2        OP_DATA                                                  !0
   24     3      > RETURN                                                   null

End of function __construct

Function returnprivate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0QEs5
function name:  returnPrivate
number of ops:  3
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   FETCH_OBJ_R                                      ~1      !0
          1      > RETURN                                                   ~1
   30     2*     > RETURN                                                   null

End of function returnprivate

End of class class@anonymous.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.15 ms | 1394 KiB | 13 Q