3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $foo = substr("foo",3); if($foo !== FALSE){ echo "PHP 7\n"; echo gettype($foo); //string } else{ echo "PHP 5\n"; echo gettype($foo); //boolean }
based on YLujH
Finding entry points
Branch analysis from position: 0
Jump found. (Code = 43) Position 1 = 7, Position 2 = 13
Branch analysis from position: 7
Jump found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Jump found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
Jump found. (Code = 62) Position 1 = -2
filename:       /in/Ol85Y
function name:  (null)
number of ops:  19
compiled vars:  !0 = $foo
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   2     0  E >   INIT_FCALL                                               'substr'
         1        SEND_VAL                                                 'foo'
         2        SEND_VAL                                                 3
         3        DO_ICALL                                         $1      
         4        ASSIGN                                                   !0, $1
   3     5        IS_NOT_IDENTICAL                                 ~3      !0, <false>
         6      > JMPZ                                                     ~3, ->13
   4     7    >   ECHO                                                     'PHP+7%0A'
   5     8        INIT_FCALL                                               'gettype'
         9        SEND_VAR                                                 !0
        10        DO_ICALL                                         $4      
        11        ECHO                                                     $4
        12      > JMP                                                      ->18
   8    13    >   ECHO                                                     'PHP+5%0A'
   9    14        INIT_FCALL                                               'gettype'
        15        SEND_VAR                                                 !0
        16        DO_ICALL                                         $5      
        17        ECHO                                                     $5
  10    18    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.1.0