3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tests = [ 71 => 72, 33.1 => 34, 20.8 => 22]; foreach($tests as $test => $expected) { $num = ceil($test); if($num % 2 == 1) $num++; echo "Expected: $expected, Actual: $num\n"; }
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 = 11, Position 2 = 12
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 12
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/9YBm9
function name:  (null)
number of ops:  21
compiled vars:  !0 = $tests, !1 = $expected, !2 = $test, !3 = $num
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1      > FE_RESET_R                                       $5      !0, ->19
          2    > > FE_FETCH_R                                       ~6      $5, !1, ->19
          3    >   ASSIGN                                                   !2, ~6
    5     4        INIT_FCALL                                               'ceil'
          5        SEND_VAR                                                 !2
          6        DO_ICALL                                         $8      
          7        ASSIGN                                                   !3, $8
    6     8        MOD                                              ~10     !3, 2
          9        IS_EQUAL                                                 ~10, 1
         10      > JMPZ                                                     ~11, ->12
         11    >   PRE_INC                                                  !3
    7    12    >   ROPE_INIT                                     5  ~14     'Expected%3A+'
         13        ROPE_ADD                                      1  ~14     ~14, !1
         14        ROPE_ADD                                      2  ~14     ~14, '%2C+Actual%3A+'
         15        ROPE_ADD                                      3  ~14     ~14, !3
         16        ROPE_END                                      4  ~13     ~14, '%0A'
         17        ECHO                                                     ~13
    4    18      > JMP                                                      ->2
         19    >   FE_FREE                                                  $5
    8    20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.12 ms | 1399 KiB | 15 Q