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 = 22, Position 2 = 23
Branch analysis from position: 22
2 jumps found. (Code = 46) Position 1 = 30, Position 2 = 31
Branch analysis from position: 30
2 jumps found. (Code = 46) Position 1 = 38, Position 2 = 39
Branch analysis from position: 38
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: 39
Branch analysis from position: 31
Branch analysis from position: 23
filename:       /in/6h0VL
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      > JMPZ_EX                                          ~30     !4, ->23
         22    >   BOOL                                             ~30     !3
         23    >   ASSIGN                                           ~31     !9, ~30
         24        SEND_VAL                                                 ~31
         25        DO_ICALL                                         $32     
         26        ECHO                                                     $32
   26    27        ECHO                                                     'Array+is+Greatest.%3A+'
         28        INIT_FCALL                                               'var_dump'
         29      > JMPZ_EX                                          ~33     !5, ->31
         30    >   BOOL                                             ~33     !6
         31    >   ASSIGN                                           ~34     !10, ~33
         32        SEND_VAL                                                 ~34
         33        DO_ICALL                                         $35     
         34        ECHO                                                     $35
   29    35        ECHO                                                     'Object+is+Greatest%3A+'
         36        INIT_FCALL                                               'var_dump'
         37      > JMPZ_EX                                          ~36     !7, ->39
         38    >   BOOL                                             ~36     !8
         39    >   ASSIGN                                           ~37     !11, ~36
         40        SEND_VAL                                                 ~37
         41        DO_ICALL                                         $38     
         42        ECHO                                                     $38
   32    43        ECHO                                                     'Undefined.........%3A+'
         44        INIT_FCALL                                               'var_dump'
   34    45      > JMPZ_EX                                          ~39     !9, ->48
         46    >   IS_EQUAL                                         ~40     !9, !10
         47        BOOL                                             ~39     ~40
         48    > > JMPNZ_EX                                         ~39     ~39, ->53
   35    49    > > JMPZ_EX                                          ~41     !10, ->52
         50    >   IS_EQUAL                                         ~42     !10, !11
         51        BOOL                                             ~41     ~42
         52    >   BOOL                                             ~39     ~41
         53    > > JMPNZ_EX                                         ~39     ~39, ->62
   36    54    >   BOOL_NOT                                         ~43     !9
         55      > JMPZ_EX                                          ~43     ~43, ->61
         56    >   IS_EQUAL                                         ~44     !9, !10
         57      > JMPZ_EX                                          ~44     ~44, ->60
         58    >   IS_EQUAL                                         ~45     !9, !11
         59        BOOL                                             ~44     ~45
         60    >   BOOL                                             ~43     ~44
         61    >   BOOL                                             ~39     ~43
   33    62    >   ASSIGN                                           ~46     !12, ~39
         63        SEND_VAL                                                 ~46
         64        DO_ICALL                                         $47     
         65        ECHO                                                     $47
   38    66      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.66 ms | 1400 KiB | 17 Q