3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyClass { private $myvar; public function __construct($myvar) { $this->myvar = $myvar; } public function getMyVar() { return $this->myvar; } public function __toString() { return "from toString: " . $this->myvar; } } $myclass = new MyClass("myvar value"); echo "Embedded class into a string: $myclass";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YFctl
function name:  (null)
number of ops:  9
compiled vars:  !0 = $myclass
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DECLARE_CLASS                                            'myclass'
   18     1        NEW                                              $1      'MyClass'
          2        SEND_VAL_EX                                              'myvar+value'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   19     5        NOP                                                      
          6        FAST_CONCAT                                      ~4      'Embedded+class+into+a+string%3A+', !0
          7        ECHO                                                     ~4
          8      > RETURN                                                   1

Class MyClass:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YFctl
function name:  __construct
number of ops:  4
compiled vars:  !0 = $myvar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        ASSIGN_OBJ                                               'myvar'
          2        OP_DATA                                                  !0
    7     3      > RETURN                                                   null

End of function __construct

Function getmyvar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YFctl
function name:  getMyVar
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   FETCH_OBJ_R                                      ~0      'myvar'
          1      > RETURN                                                   ~0
   11     2*     > RETURN                                                   null

End of function getmyvar

Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YFctl
function name:  __toString
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   FETCH_OBJ_R                                      ~0      'myvar'
          1        CONCAT                                           ~1      'from+toString%3A+', ~0
          2        VERIFY_RETURN_TYPE                                       ~1
          3      > RETURN                                                   ~1
   15     4*       VERIFY_RETURN_TYPE                                       
          5*     > RETURN                                                   null

End of function __tostring

End of class MyClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.67 ms | 1003 KiB | 13 Q