3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test{ public $value = 123; public function __construct($a) { echo "Wow!"; $this->value = (yield $a); } } $obj = new Test(456); var_dump($obj, $obj->__construct('456'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MAeTq
function name:  (null)
number of ops:  12
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $1      'Test'
          1        SEND_VAL_EX                                              456
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   16     4        INIT_FCALL                                               'var_dump'
          5        SEND_VAR                                                 !0
          6        INIT_METHOD_CALL                                         !0, '__construct'
          7        SEND_VAL_EX                                              '456'
          8        DO_FCALL                                      0  $4      
          9        SEND_VAR                                                 $4
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Class Test:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/MAeTq
function name:  __construct
number of ops:  7
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        GENERATOR_CREATE                                         
    8     2        ECHO                                                     'Wow%21'
    9     3        YIELD                                            $2      !0
          4        ASSIGN_OBJ                                               'value'
          5        OP_DATA                                                  $2
   10     6      > GENERATOR_RETURN                                         

End of function __construct

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.34 ms | 1395 KiB | 15 Q