3v4l.org

run code in 300+ PHP versions simultaneously
<?php function bool2str($bool) { if ($bool === false) { return 'FALSE'; } else { return 'TRUE'; } } $o1 = new stdClass(); $o1->prop1 = 'c'; $o1->prop2 = 25; $o1->prop3 = 201; $o1->prop4 = 1000; $o2 = new stdClass(); $o2->prop1 = 'c'; $o2->prop2 = 25; $o2->prop3 = 200; $o2->prop4 = 9999; echo (int)($o1 < $o2); // 0 echo (int)($o1 > $o2); // 1 $o1->prop3 = 200; echo (int)($o1 < $o2); // 1 echo (int)($o1 > $o2); // 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aea27
function name:  (null)
number of ops:  37
compiled vars:  !0 = $o1, !1 = $o2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                                              $2      'stdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   13     3        ASSIGN_OBJ                                               !0, 'prop1'
          4        OP_DATA                                                  'c'
   14     5        ASSIGN_OBJ                                               !0, 'prop2'
          6        OP_DATA                                                  25
   15     7        ASSIGN_OBJ                                               !0, 'prop3'
          8        OP_DATA                                                  201
   16     9        ASSIGN_OBJ                                               !0, 'prop4'
         10        OP_DATA                                                  1000
   18    11        NEW                                              $9      'stdClass'
         12        DO_FCALL                                      0          
         13        ASSIGN                                                   !1, $9
   19    14        ASSIGN_OBJ                                               !1, 'prop1'
         15        OP_DATA                                                  'c'
   20    16        ASSIGN_OBJ                                               !1, 'prop2'
         17        OP_DATA                                                  25
   21    18        ASSIGN_OBJ                                               !1, 'prop3'
         19        OP_DATA                                                  200
   22    20        ASSIGN_OBJ                                               !1, 'prop4'
         21        OP_DATA                                                  9999
   24    22        IS_SMALLER                                       ~16     !0, !1
         23        CAST                                          4  ~17     ~16
         24        ECHO                                                     ~17
   25    25        IS_SMALLER                                       ~18     !1, !0
         26        CAST                                          4  ~19     ~18
         27        ECHO                                                     ~19
   27    28        ASSIGN_OBJ                                               !0, 'prop3'
         29        OP_DATA                                                  200
   29    30        IS_SMALLER                                       ~21     !0, !1
         31        CAST                                          4  ~22     ~21
         32        ECHO                                                     ~22
   30    33        IS_SMALLER                                       ~23     !1, !0
         34        CAST                                          4  ~24     ~23
         35        ECHO                                                     ~24
         36      > RETURN                                                   1

Function bool2str:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aea27
function name:  bool2str
number of ops:  7
compiled vars:  !0 = $bool
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        TYPE_CHECK                                    4          !0
          2      > JMPZ                                                     ~1, ->5
    6     3    > > RETURN                                                   'FALSE'
    5     4*       JMP                                                      ->6
    8     5    > > RETURN                                                   'TRUE'
   10     6*     > RETURN                                                   null

End of function bool2str

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
246.88 ms | 947 KiB | 13 Q