3v4l.org

run code in 500+ PHP versions simultaneously
<?php class X { protected $name = 'I am X.'; public function __toString() { return $this->name; } } class Y { public function write(string $classy) { return $classy; } } $x = new X(); $y = new Y(); var_export($y->write($x));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LnIRE
function name:  (null)
number of ops:  14
compiled vars:  !0 = $x, !1 = $y
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                                'x'
   21     1        NEW                                                  $2      'X'
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !0, $2
   22     4        NEW                                                  $5      'Y'
          5        DO_FCALL                                          0          
          6        ASSIGN                                                       !1, $5
   24     7        INIT_FCALL                                                   'var_export'
          8        INIT_METHOD_CALL                                             !1, 'write'
          9        SEND_VAR_EX                                                  !0
         10        DO_FCALL                                          0  $8      
         11        SEND_VAR                                                     $8
         12        DO_ICALL                                                     
         13      > RETURN                                                       1

Class X:
Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LnIRE
function name:  __toString
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   FETCH_OBJ_R                                          ~0      'name'
          1        VERIFY_RETURN_TYPE                                           ~0
          2      > RETURN                                                       ~0
   10     3*       VERIFY_RETURN_TYPE                                           
          4*     > RETURN                                                       null

End of function __tostring

End of class X.

Class Y:
Function write:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LnIRE
function name:  write
number of ops:  3
compiled vars:  !0 = $classy
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   15     0  E >   RECV                                                 !0      
   17     1      > RETURN                                                       !0
   18     2*     > RETURN                                                       null

End of function write

End of class Y.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
156.83 ms | 1969 KiB | 14 Q