3v4l.org

run code in 300+ PHP versions simultaneously
<?php $total = 0.0; $expected = 1.0; for ($i = 0; $i < 10; $i++) { $total += 0.1; } echo "added ten cents\n"; // since we added 0.1 € x 10 times, we now have 1€ in total, right? if ($total == $expected) { echo "I have {$expected}€. All is good in the realm."; } else { echo "WTF? Where is my money? I only have {$total}€!!!!\n"; echo "\$total holds:"; var_dump($total); } $balance = 50.03; $debit = 45.42; $expected_balance = 4.61; $real_balance = $balance - $debit; if ($real_balance !== $expected_balance) { echo "balance mismatch: "; var_dump($real_balance); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 4
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 16
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 31, Position 2 = 35
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 31, Position 2 = 35
Branch analysis from position: 31
Branch analysis from position: 35
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 4
Branch analysis from position: 8
Branch analysis from position: 4
filename:       /in/3Ya5L
function name:  (null)
number of ops:  36
compiled vars:  !0 = $total, !1 = $expected, !2 = $i, !3 = $balance, !4 = $debit, !5 = $expected_balance, !6 = $real_balance
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 0
    4     1        ASSIGN                                                   !1, 1
    5     2        ASSIGN                                                   !2, 0
          3      > JMP                                                      ->6
    6     4    >   ASSIGN_OP                                     1          !0, 0.1
    5     5        PRE_INC                                                  !2
          6    >   IS_SMALLER                                               !2, 10
          7      > JMPNZ                                                    ~12, ->4
    9     8    >   ECHO                                                     'added+ten+cents%0A'
   12     9        IS_EQUAL                                                 !0, !1
         10      > JMPZ                                                     ~13, ->16
   13    11    >   ROPE_INIT                                     3  ~15     'I+have+'
         12        ROPE_ADD                                      1  ~15     ~15, !1
         13        ROPE_END                                      2  ~14     ~15, '%E2%82%AC.+All+is+good+in+the+realm.'
         14        ECHO                                                     ~14
         15      > JMP                                                      ->24
   16    16    >   ROPE_INIT                                     3  ~18     'WTF%3F+Where+is+my+money%3F+I+only+have+'
         17        ROPE_ADD                                      1  ~18     ~18, !0
         18        ROPE_END                                      2  ~17     ~18, '%E2%82%AC%21%21%21%21%0A'
         19        ECHO                                                     ~17
   17    20        ECHO                                                     '%24total+holds%3A'
   18    21        INIT_FCALL                                               'var_dump'
         22        SEND_VAR                                                 !0
         23        DO_ICALL                                                 
   22    24    >   ASSIGN                                                   !3, 50.03
   23    25        ASSIGN                                                   !4, 45.42
   24    26        ASSIGN                                                   !5, 4.61
   25    27        SUB                                              ~24     !3, !4
         28        ASSIGN                                                   !6, ~24
   28    29        IS_NOT_IDENTICAL                                         !6, !5
         30      > JMPZ                                                     ~26, ->35
   29    31    >   ECHO                                                     'balance+mismatch%3A+'
   30    32        INIT_FCALL                                               'var_dump'
         33        SEND_VAR                                                 !6
         34        DO_ICALL                                                 
   31    35    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.77 ms | 1411 KiB | 15 Q