3v4l.org

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

Class A:
Function s:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 2, Position 2 = 4
Branch analysis from position: 2
Jump found. Position 1 = 5
Branch analysis from position: 5
Jump found. Position 1 = -2
Branch analysis from position: 4
Jump found. Position 1 = -2
filename:       /in/cLPIZ
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      'r'
         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 7.1.0