3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.88 ms | 1392 KiB | 17 Q