3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Which one is greatest? */ error_reporting(E_ALL ^ E_NOTICES); $inf = INF; $array = array(); $object = (object) $array; $InfGreaterThanArray = ($inf > $array); $InfGreaterThanObject = ($inf > $object); $arrayGreaterThanInf = ($array > $inf); $arrayGreaterThanObject = ($array > $object); $objectGreaterThanInf = ($object > $inf); $objectGreaterThanArray = ($object > array()); // Test1: Is INF greatest? # boolean(false) echo 'Inf is Greatest:', var_dump($InfIsGreatest = $InfGreaterThanObject and $InfGreaterThanArray); // Test2: Is Array greatest? # boolean(false) echo 'Array is Greatest:', var_dump($arrayIsGreatest = $arrayGreaterThanInf and $arrayGreaterThanObject); // Test3: Is Object greatest? # boolean(false) echo 'Object is Greatest:', var_dump($objectIsGreatest = $objectGreaterThanInf and $objectGreaterThanArray); // Test4: Undefined? # boolean(true) echo 'Undefined:', var_dump( $undefined = ( ($InfIsGreatest and $InfIsGreatest == $arrayIsGreatest) || ($arrayIsGreatest and $arrayIsGreatest == $objectIsGreatest) || (!$InfIsGreatest and $InfIsGreatest == $arrayIsGreatest and $InfIsGreatest == $objectIsGreatest) ) );
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 25, Position 2 = 26
Branch analysis from position: 25
2 jumps found. (Code = 46) Position 1 = 33, Position 2 = 34
Branch analysis from position: 33
2 jumps found. (Code = 46) Position 1 = 41, Position 2 = 42
Branch analysis from position: 41
2 jumps found. (Code = 46) Position 1 = 48, Position 2 = 50
Branch analysis from position: 48
2 jumps found. (Code = 47) Position 1 = 51, Position 2 = 55
Branch analysis from position: 51
2 jumps found. (Code = 46) Position 1 = 52, Position 2 = 54
Branch analysis from position: 52
2 jumps found. (Code = 47) Position 1 = 56, Position 2 = 64
Branch analysis from position: 56
2 jumps found. (Code = 46) Position 1 = 58, Position 2 = 60
Branch analysis from position: 58
2 jumps found. (Code = 46) Position 1 = 61, Position 2 = 63
Branch analysis from position: 61
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 63
Branch analysis from position: 60
Branch analysis from position: 64
Branch analysis from position: 54
Branch analysis from position: 55
Branch analysis from position: 50
Branch analysis from position: 42
Branch analysis from position: 34
Branch analysis from position: 26
filename:       /in/2eAAR
function name:  (null)
number of ops:  69
compiled vars:  !0 = $inf, !1 = $array, !2 = $object, !3 = $InfGreaterThanArray, !4 = $InfGreaterThanObject, !5 = $arrayGreaterThanInf, !6 = $arrayGreaterThanObject, !7 = $objectGreaterThanInf, !8 = $objectGreaterThanArray, !9 = $InfIsGreatest, !10 = $arrayIsGreatest, !11 = $objectIsGreatest, !12 = $undefined
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_FCALL                                               'error_reporting'
          1        FETCH_CONSTANT                                   ~13     'E_NOTICES'
          2        BW_XOR                                           ~14     ~13, 32767
          3        SEND_VAL                                                 ~14
          4        DO_ICALL                                                 
    8     5        ASSIGN                                                   !0, INF
    9     6        ASSIGN                                                   !1, <array>
   10     7        CAST                                          8  ~18     !1
          8        ASSIGN                                                   !2, ~18
   12     9        IS_SMALLER                                       ~20     !1, !0
         10        ASSIGN                                                   !3, ~20
   13    11        IS_SMALLER                                       ~22     !2, !0
         12        ASSIGN                                                   !4, ~22
   15    13        IS_SMALLER                                       ~24     !0, !1
         14        ASSIGN                                                   !5, ~24
   16    15        IS_SMALLER                                       ~26     !2, !1
         16        ASSIGN                                                   !6, ~26
   18    17        IS_SMALLER                                       ~28     !0, !2
         18        ASSIGN                                                   !7, ~28
   19    19        IS_SMALLER                                       ~30     <array>, !2
         20        ASSIGN                                                   !8, ~30
   23    21        ECHO                                                     'Inf+is+Greatest%3A'
         22        INIT_FCALL                                               'var_dump'
         23        ASSIGN                                           ~32     !9, !4
         24      > JMPZ_EX                                          ~32     ~32, ->26
         25    >   BOOL                                             ~32     !3
         26    >   SEND_VAL                                                 ~32
         27        DO_ICALL                                         $33     
         28        ECHO                                                     $33
   26    29        ECHO                                                     'Array+is+Greatest%3A'
         30        INIT_FCALL                                               'var_dump'
         31        ASSIGN                                           ~34     !10, !5
         32      > JMPZ_EX                                          ~34     ~34, ->34
         33    >   BOOL                                             ~34     !6
         34    >   SEND_VAL                                                 ~34
         35        DO_ICALL                                         $35     
         36        ECHO                                                     $35
   29    37        ECHO                                                     'Object+is+Greatest%3A'
         38        INIT_FCALL                                               'var_dump'
         39        ASSIGN                                           ~36     !11, !7
         40      > JMPZ_EX                                          ~36     ~36, ->42
         41    >   BOOL                                             ~36     !8
         42    >   SEND_VAL                                                 ~36
         43        DO_ICALL                                         $37     
         44        ECHO                                                     $37
   32    45        ECHO                                                     'Undefined%3A'
         46        INIT_FCALL                                               'var_dump'
   34    47      > JMPZ_EX                                          ~38     !9, ->50
         48    >   IS_EQUAL                                         ~39     !9, !10
         49        BOOL                                             ~38     ~39
         50    > > JMPNZ_EX                                         ~38     ~38, ->55
   35    51    > > JMPZ_EX                                          ~40     !10, ->54
         52    >   IS_EQUAL                                         ~41     !10, !11
         53        BOOL                                             ~40     ~41
         54    >   BOOL                                             ~38     ~40
         55    > > JMPNZ_EX                                         ~38     ~38, ->64
   36    56    >   BOOL_NOT                                         ~42     !9
         57      > JMPZ_EX                                          ~42     ~42, ->60
         58    >   IS_EQUAL                                         ~43     !9, !10
         59        BOOL                                             ~42     ~43
         60    > > JMPZ_EX                                          ~42     ~42, ->63
         61    >   IS_EQUAL                                         ~44     !9, !11
         62        BOOL                                             ~42     ~44
         63    >   BOOL                                             ~38     ~42
   33    64    >   ASSIGN                                           ~45     !12, ~38
         65        SEND_VAL                                                 ~45
         66        DO_ICALL                                         $46     
         67        ECHO                                                     $46
   38    68      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.63 ms | 1400 KiB | 17 Q