3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a { private $b; function __construct($b = NULL) { if ($b) $this->b = $b; else $this->b = new b($this); $this->b->test(); } public function test() { echo ($this->b !== NULL) ? __METHOD__.":: b not NULL\n" : __METHOD__." :: b NULL\n"; } } class b { private $a; function __construct($a = NULL) { if ($a) $this->a = $a; else $this->a = new a($this); $this->a->test(); } public function test() { echo ($this->a !== NULL) ? __METHOD__.":: a not NULL\n" : __METHOD__." :: a NULL\n"; } } new a;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AHanl
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   33     0  E >   NEW                                              $0      'a'
          1        DO_FCALL                                      0          
          2        FREE                                                     $0
          3      > RETURN                                                   1

Class a:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 5
Branch analysis from position: 2
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AHanl
function name:  __construct
number of ops:  15
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV_INIT                                        !0      null
    8     1      > JMPZ                                                     !0, ->5
          2    >   ASSIGN_OBJ                                               'b'
          3        OP_DATA                                                  !0
          4      > JMP                                                      ->11
    9     5    >   NEW                                              $3      'b'
          6        FETCH_THIS                                       $4      
          7        SEND_VAR_EX                                              $4
          8        DO_FCALL                                      0          
          9        ASSIGN_OBJ                                               'b'
         10        OP_DATA                                                  $3
   10    11    >   FETCH_OBJ_R                                      ~6      'b'
         12        INIT_METHOD_CALL                                         ~6, 'test'
         13        DO_FCALL                                      0          
   11    14      > RETURN                                                   null

End of function __construct

Function test:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AHanl
function name:  test
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   FETCH_OBJ_R                                      ~0      'b'
          1        TYPE_CHECK                                  1020          ~0
          2      > JMPZ                                                     ~1, ->5
          3    >   QM_ASSIGN                                        ~2      'a%3A%3Atest%3A%3A+b+not+NULL%0A'
          4      > JMP                                                      ->6
          5    >   QM_ASSIGN                                        ~2      'a%3A%3Atest+%3A%3A+b+NULL%0A'
          6    >   ECHO                                                     ~2
   15     7      > RETURN                                                   null

End of function test

End of class a.

Class b:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 5
Branch analysis from position: 2
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AHanl
function name:  __construct
number of ops:  15
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   RECV_INIT                                        !0      null
   23     1      > JMPZ                                                     !0, ->5
          2    >   ASSIGN_OBJ                                               'a'
          3        OP_DATA                                                  !0
          4      > JMP                                                      ->11
   24     5    >   NEW                                              $3      'a'
          6        FETCH_THIS                                       $4      
          7        SEND_VAR_EX                                              $4
          8        DO_FCALL                                      0          
          9        ASSIGN_OBJ                                               'a'
         10        OP_DATA                                                  $3
   25    11    >   FETCH_OBJ_R                                      ~6      'a'
         12        INIT_METHOD_CALL                                         ~6, 'test'
         13        DO_FCALL                                      0          
   26    14      > RETURN                                                   null

End of function __construct

Function test:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AHanl
function name:  test
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   FETCH_OBJ_R                                      ~0      'a'
          1        TYPE_CHECK                                  1020          ~0
          2      > JMPZ                                                     ~1, ->5
          3    >   QM_ASSIGN                                        ~2      'b%3A%3Atest%3A%3A+a+not+NULL%0A'
          4      > JMP                                                      ->6
          5    >   QM_ASSIGN                                        ~2      'b%3A%3Atest+%3A%3A+a+NULL%0A'
          6    >   ECHO                                                     ~2
   30     7      > RETURN                                                   null

End of function test

End of class b.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.27 ms | 1390 KiB | 13 Q