3v4l.org

run code in 300+ PHP versions simultaneously
<?php // $a = array("1"=>2,"2"=>8,"3"=>9,"4"=>8,"5"=>6,"6"=>7,"7"=>9,"8"=>2); // used short array notation (see references) and removed keys (since not used) $numbers = [2,8,9,8,6,7,9,2,95890814984141]; // the last number is for my pleasure :P $numberFormatter = new NumberFormatter('en', NumberFormatter::SPELLOUT); foreach ($numbers as $number) { $numberSpelled = $numberFormatter->format($number); $numberSpelledWithFirstCharUpper = ucfirst($numberSpelled); echo $numberSpelledWithFirstCharUpper . ' - ' . $number . PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 22
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 22
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/1mcaS
function name:  (null)
number of ops:  24
compiled vars:  !0 = $numbers, !1 = $numberFormatter, !2 = $number, !3 = $numberSpelled, !4 = $numberSpelledWithFirstCharUpper
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, <array>
    5     1        NEW                                              $6      'NumberFormatter'
          2        SEND_VAL_EX                                              'en'
          3        FETCH_CLASS_CONSTANT                             ~7      'NumberFormatter', 'SPELLOUT'
          4        SEND_VAL_EX                                              ~7
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $6
    7     7      > FE_RESET_R                                       $10     !0, ->22
          8    > > FE_FETCH_R                                               $10, !2, ->22
    8     9    >   INIT_METHOD_CALL                                         !1, 'format'
         10        SEND_VAR_EX                                              !2
         11        DO_FCALL                                      0  $11     
         12        ASSIGN                                                   !3, $11
    9    13        INIT_FCALL                                               'ucfirst'
         14        SEND_VAR                                                 !3
         15        DO_ICALL                                         $13     
         16        ASSIGN                                                   !4, $13
   11    17        CONCAT                                           ~15     !4, '+-+'
         18        CONCAT                                           ~16     ~15, !2
         19        CONCAT                                           ~17     ~16, '%0A'
         20        ECHO                                                     ~17
    7    21      > JMP                                                      ->8
         22    >   FE_FREE                                                  $10
   12    23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.52 ms | 1436 KiB | 14 Q