3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { /** @return A */ public function s() {return $this->{'v'} ? 1 : 0;} /** @var mixed */ private $r; } $a = new A; echo $a->s(); echo $a->s();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5IfM6
function name:  (null)
number of ops:  10
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   11     3        INIT_METHOD_CALL                                         !0, 's'
          4        DO_FCALL                                      0  $4      
          5        ECHO                                                     $4
   12     6        INIT_METHOD_CALL                                         !0, 's'
          7        DO_FCALL                                      0  $5      
          8        ECHO                                                     $5
          9      > RETURN                                                   1

Class A:
Function s:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 4
Branch analysis from position: 2
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5IfM6
function name:  s
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   FETCH_OBJ_R                                      ~0      'v'
          1      > JMPZ                                                     ~0, ->4
          2    >   QM_ASSIGN                                        ~1      1
          3      > JMP                                                      ->5
          4    >   QM_ASSIGN                                        ~1      0
          5    > > RETURN                                                   ~1
          6*     > RETURN                                                   null

End of function s

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.67 ms | 1394 KiB | 13 Q