3v4l.org

run code in 300+ PHP versions simultaneously
<?php class test { var $value; var $young_myself; function __construct($var) { test($var); } function test($var) { $this->value=$var; if($self > 10) $this->young_myself=new self($var-10); else $this->young_myself = FALSE; } function getAge(){ if(!!$this->young_myself) return $this->value; else return "Not birth yet"; } } $new = new test(51); echo $new->young_myself->young_myself->young_myself->young_myself->young_myself->getAge();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hAetn
function name:  (null)
number of ops:  13
compiled vars:  !0 = $new
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   NEW                                              $1      'test'
          1        SEND_VAL_EX                                              51
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   26     4        FETCH_OBJ_R                                      ~4      !0, 'young_myself'
          5        FETCH_OBJ_R                                      ~5      ~4, 'young_myself'
          6        FETCH_OBJ_R                                      ~6      ~5, 'young_myself'
          7        FETCH_OBJ_R                                      ~7      ~6, 'young_myself'
          8        FETCH_OBJ_R                                      ~8      ~7, 'young_myself'
          9        INIT_METHOD_CALL                                         ~8, 'getAge'
         10        DO_FCALL                                      0  $9      
         11        ECHO                                                     $9
         12      > RETURN                                                   1

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

End of function __construct

Function test:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 12
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hAetn
function name:  test
number of ops:  15
compiled vars:  !0 = $var, !1 = $self
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   14     1        ASSIGN_OBJ                                               'value'
          2        OP_DATA                                                  !0
   15     3        IS_SMALLER                                               10, !1
          4      > JMPZ                                                     ~3, ->12
          5    >   NEW                          self                $5      
          6        SUB                                              ~6      !0, 10
          7        SEND_VAL_EX                                              ~6
          8        DO_FCALL                                      0          
          9        ASSIGN_OBJ                                               'young_myself'
         10        OP_DATA                                                  $5
         11      > JMP                                                      ->14
   16    12    >   ASSIGN_OBJ                                               'young_myself'
         13        OP_DATA                                                  <false>
   17    14    > > RETURN                                                   null

End of function test

Function getage:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hAetn
function name:  getAge
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   FETCH_OBJ_R                                      ~0      'young_myself'
          1        BOOL_NOT                                         ~1      ~0
          2        BOOL_NOT                                         ~2      ~1
          3      > JMPZ                                                     ~2, ->7
          4    >   FETCH_OBJ_R                                      ~3      'value'
          5      > RETURN                                                   ~3
          6*       JMP                                                      ->8
   21     7    > > RETURN                                                   'Not+birth+yet'
   22     8*     > RETURN                                                   null

End of function getage

End of class test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.48 ms | 1399 KiB | 13 Q