3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tests = [ 1.25, 2.500, 31, 0.99999999999999 ]; foreach ($tests as $testValue) { $testInt = intval(100 * $testValue); if (($testInt % 100) == 0) { echo "".($testInt / 100)."\n"; } else { printf("%.2f \n", $testValue); } } echo "The last might not be what you want.";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 19
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 19
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 14
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/S7GK3
function name:  (null)
number of ops:  22
compiled vars:  !0 = $tests, !1 = $testValue, !2 = $testInt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1      > FE_RESET_R                                       $4      !0, ->19
          2    > > FE_FETCH_R                                               $4, !1, ->19
    6     3    >   MUL                                              ~5      !1, 100
          4        CAST                                          4  ~6      ~5
          5        ASSIGN                                                   !2, ~6
    7     6        MOD                                              ~8      !2, 100
          7        IS_EQUAL                                                 ~8, 0
          8      > JMPZ                                                     ~9, ->14
    8     9    >   DIV                                              ~10     !2, 100
         10        CONCAT                                           ~11     '', ~10
         11        CONCAT                                           ~12     ~11, '%0A'
         12        ECHO                                                     ~12
    7    13      > JMP                                                      ->18
   11    14    >   INIT_FCALL                                               'printf'
         15        SEND_VAL                                                 '%25.2f+%0A'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                                 
    5    18    > > JMP                                                      ->2
         19    >   FE_FREE                                                  $4
   15    20        ECHO                                                     'The+last+might+not+be+what+you+want.'
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.55 ms | 998 KiB | 14 Q