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; } $hello->say = $val; } } $test1 = new Hello; $test2 = new Hello; $test1->say($test2, 'Hello'); $test2->say();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jZTGb
function name:  (null)
number of ops:  13
compiled vars:  !0 = $test1, !1 = $test2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $2      'Hello'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   20     3        NEW                                              $5      'Hello'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $5
   22     6        INIT_METHOD_CALL                                         !0, 'say'
          7        SEND_VAR_EX                                              !1
          8        SEND_VAL_EX                                              'Hello'
          9        DO_FCALL                                      0          
   24    10        INIT_METHOD_CALL                                         !1, 'say'
         11        DO_FCALL                                      0          
         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/jZTGb
function name:  say
number of ops:  9
compiled vars:  !0 = $obj, !1 = $val, !2 = $hello
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                                                     ~3, ->6
   12     4    >   FETCH_OBJ_R                                      ~4      'say'
          5      > RETURN                                                   ~4
   15     6    >   ASSIGN_OBJ                                               !2, 'say'
          7        OP_DATA                                                  !1
   16     8      > RETURN                                                   null

End of function say

End of class Hello.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.38 ms | 1394 KiB | 13 Q