3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Hello{ private $say; public function say(Hello $obj = null, $val = null) { if (null === $obj) { return $this->say; } $obj->say = $val; } public function __toString() { return $this->say; } } $test1 = new Hello; $test2 = new Hello; $test1->say($test2, 'Hello'); echo $test2;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/agaY0
function name:  (null)
number of ops:  13
compiled vars:  !0 = $test1, !1 = $test2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   DECLARE_CLASS                                            'hello'
   25     1        NEW                                              $2      'Hello'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   26     4        NEW                                              $5      'Hello'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $5
   28     7        INIT_METHOD_CALL                                         !0, 'say'
          8        SEND_VAR_EX                                              !1
          9        SEND_VAL_EX                                              'Hello'
         10        DO_FCALL                                      0          
   30    11        ECHO                                                     !1
         12      > RETURN                                                   1

Class Hello:
Function say:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/agaY0
function name:  say
number of ops:  9
compiled vars:  !0 = $obj, !1 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV_INIT                                        !0      null
          1        RECV_INIT                                        !1      null
   10     2        TYPE_CHECK                                    2          !0
          3      > JMPZ                                                     ~2, ->6
   12     4    >   FETCH_OBJ_R                                      ~3      'say'
          5      > RETURN                                                   ~3
   15     6    >   ASSIGN_OBJ                                               !0, 'say'
          7        OP_DATA                                                  !1
   16     8      > RETURN                                                   null

End of function say

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

End of function __tostring

End of class Hello.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.41 ms | 1395 KiB | 13 Q