3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $client_version_header = '1.5'; $oldVersion = false; if(!$client_version_header){ $oldVersion = true; } else { $splitted = explode('.', $client_version_header); $major = $splitted[0]; $minor = $splitted[1]; if($major < 1){ $oldVersion = true; } if($major == 1 && $minor < 5){ $oldVersion = true; } } if($oldVersion) { echo 'oldversion'; } else { echo 'newVersion'; }
based on 8kt3F
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
Jump found. Position 1 = 24
Branch analysis from position: 24
Jump found. Position 1 = 25, Position 2 = 27
Branch analysis from position: 25
Jump found. Position 1 = 28
Branch analysis from position: 28
Jump found. Position 1 = -2
Branch analysis from position: 27
Jump found. Position 1 = -2
Branch analysis from position: 6
Jump found. Position 1 = 17, Position 2 = 18
Branch analysis from position: 17
Jump found. Position 1 = 20, Position 2 = 22
Branch analysis from position: 20
Jump found. Position 1 = 23, Position 2 = 24
Branch analysis from position: 23
Jump found. Position 1 = 25, Position 2 = 27
Branch analysis from position: 25
Branch analysis from position: 27
Branch analysis from position: 24
Branch analysis from position: 22
Branch analysis from position: 18
filename:       /in/8pJDi
function name:  (null)
number of ops:  29
compiled vars:  !0 = $client_version_header, !1 = $oldVersion, !2 = $splitted, !3 = $major, !4 = $minor
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   2     0  E >   ASSIGN                                                   !0, '1.5'
   3     1        ASSIGN                                                   !1, <false>
   4     2        BOOL_NOT                                         ~7      !0
         3      > JMPZ                                                     ~7, ->6
   5     4    >   ASSIGN                                                   !1, <true>
         5      > JMP                                                      ->24
   8     6    >   INIT_FCALL                                               'explode'
         7        SEND_VAL                                                 '.'
         8        SEND_VAR                                                 !0
         9        DO_ICALL                                         $9      
        10        ASSIGN                                                   !2, $9
   9    11        FETCH_DIM_R                                      $11     !2, 0
        12        ASSIGN                                                   !3, $11
  10    13        FETCH_DIM_R                                      $13     !2, 1
        14        ASSIGN                                                   !4, $13
  11    15        IS_SMALLER                                       ~15     !3, 1
        16      > JMPZ                                                     ~15, ->18
  12    17    >   ASSIGN                                                   !1, <true>
  14    18    >   IS_EQUAL                                         ~17     !3, 1
        19      > JMPZ_EX                                          ~17     ~17, ->22
        20    >   IS_SMALLER                                       ~18     !4, 5
        21        BOOL                                             ~17     ~18
        22    > > JMPZ                                                     ~17, ->24
  15    23    >   ASSIGN                                                   !1, <true>
  18    24    > > JMPZ                                                     !1, ->27
  19    25    >   ECHO                                                     'oldversion'
        26      > JMP                                                      ->28
  23    27    >   ECHO                                                     'newVersion'
        28    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.3.0