3v4l.org

run code in 500+ PHP versions simultaneously
<?php $reviews=[ (object)['rate'=>0], (object)['rate'=>.5], (object)['rate'=>1], (object)['rate'=>1.5], (object)['rate'=>2], (object)['rate'=>2.5], (object)['rate'=>3], (object)['rate'=>3.5], (object)['rate'=>4], (object)['rate'=>4.5], (object)['rate'=>5] ]; foreach ($reviews as $review){ for($i=0; $i<5; ++$i){ echo '<i class="fa fa-star', ($review->rate==$i+.5?'-half':''), ($review->rate<=$i?'-o':''), '" aria-hidden="true"></i>'; echo "\n"; } echo "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 24, Position 2 = 50
Branch analysis from position: 24
2 jumps found. (Code = 78) Position 1 = 25, Position 2 = 50
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 46
Branch analysis from position: 46
2 jumps found. (Code = 44) Position 1 = 48, Position 2 = 27
Branch analysis from position: 48
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
Branch analysis from position: 27
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 34
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
2 jumps found. (Code = 43) Position 1 = 39, Position 2 = 41
Branch analysis from position: 39
1 jumps found. (Code = 42) Position 1 = 42
Branch analysis from position: 42
2 jumps found. (Code = 44) Position 1 = 48, Position 2 = 27
Branch analysis from position: 48
Branch analysis from position: 27
Branch analysis from position: 41
2 jumps found. (Code = 44) Position 1 = 48, Position 2 = 27
Branch analysis from position: 48
Branch analysis from position: 27
Branch analysis from position: 34
2 jumps found. (Code = 43) Position 1 = 39, Position 2 = 41
Branch analysis from position: 39
Branch analysis from position: 41
Branch analysis from position: 50
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 50
filename:       /in/r4c6R
function name:  (null)
number of ops:  52
compiled vars:  !0 = $reviews, !1 = $review, !2 = $i
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   CAST                                              8  ~3      <array>
          1        INIT_ARRAY                                           ~4      ~3
          2        CAST                                              8  ~5      <array>
          3        ADD_ARRAY_ELEMENT                                    ~4      ~5
          4        CAST                                              8  ~6      <array>
          5        ADD_ARRAY_ELEMENT                                    ~4      ~6
          6        CAST                                              8  ~7      <array>
          7        ADD_ARRAY_ELEMENT                                    ~4      ~7
          8        CAST                                              8  ~8      <array>
          9        ADD_ARRAY_ELEMENT                                    ~4      ~8
         10        CAST                                              8  ~9      <array>
         11        ADD_ARRAY_ELEMENT                                    ~4      ~9
         12        CAST                                              8  ~10     <array>
         13        ADD_ARRAY_ELEMENT                                    ~4      ~10
         14        CAST                                              8  ~11     <array>
         15        ADD_ARRAY_ELEMENT                                    ~4      ~11
         16        CAST                                              8  ~12     <array>
         17        ADD_ARRAY_ELEMENT                                    ~4      ~12
         18        CAST                                              8  ~13     <array>
         19        ADD_ARRAY_ELEMENT                                    ~4      ~13
         20        CAST                                              8  ~14     <array>
         21        ADD_ARRAY_ELEMENT                                    ~4      ~14
    2    22        ASSIGN                                                       !0, ~4
   15    23      > FE_RESET_R                                           $16     !0, ->50
         24    > > FE_FETCH_R                                                   $16, !1, ->50
   16    25    >   ASSIGN                                                       !2, 0
         26      > JMP                                                          ->46
   17    27    >   ECHO                                                         '%3Ci+class%3D%22fa+fa-star'
   18    28        FETCH_OBJ_R                                          ~18     !1, 'rate'
         29        ADD                                                  ~19     !2, 0.5
         30        IS_EQUAL                                                     ~18, ~19
         31      > JMPZ                                                         ~20, ->34
         32    >   QM_ASSIGN                                            ~21     '-half'
         33      > JMP                                                          ->35
         34    >   QM_ASSIGN                                            ~21     ''
         35    >   ECHO                                                         ~21
   19    36        FETCH_OBJ_R                                          ~22     !1, 'rate'
         37        IS_SMALLER_OR_EQUAL                                          ~22, !2
         38      > JMPZ                                                         ~23, ->41
         39    >   QM_ASSIGN                                            ~24     '-o'
         40      > JMP                                                          ->42
         41    >   QM_ASSIGN                                            ~24     ''
         42    >   ECHO                                                         ~24
   20    43        ECHO                                                         '%22+aria-hidden%3D%22true%22%3E%3C%2Fi%3E'
   21    44        ECHO                                                         '%0A'
   16    45        PRE_INC                                                      !2
         46    >   IS_SMALLER                                                   !2, 5
         47      > JMPNZ                                                        ~26, ->27
   23    48    >   ECHO                                                         '%0A'
   15    49      > JMP                                                          ->24
         50    >   FE_FREE                                                      $16
   24    51      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
183.13 ms | 3655 KiB | 13 Q