3v4l.org

run code in 300+ PHP versions simultaneously
<?php function formatNumbers(NumberFormatter $formatter, ...$numbers) { foreach ($numbers as $number) { yield $formatter->format($number); } } $formatter = new NumberFormatter('en_US', NumberFormatter::DECIMAL); $format_iter = formatNumbers($formatter, 1234, 5678, 0123, 999, 1337); foreach ($format_iter as $formatted) { var_dump($formatted); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 16, Position 2 = 21
Branch analysis from position: 16
2 jumps found. (Code = 78) Position 1 = 17, Position 2 = 21
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/WlBFJ
function name:  (null)
number of ops:  23
compiled vars:  !0 = $formatter, !1 = $format_iter, !2 = $formatted
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   NEW                                              $3      'NumberFormatter'
          1        SEND_VAL_EX                                              'en_US'
          2        FETCH_CLASS_CONSTANT                             ~4      'NumberFormatter', 'DECIMAL'
          3        SEND_VAL_EX                                              ~4
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $3
   11     6        INIT_FCALL                                               'formatnumbers'
          7        SEND_VAR                                                 !0
          8        SEND_VAL                                                 1234
          9        SEND_VAL                                                 5678
         10        SEND_VAL                                                 83
         11        SEND_VAL                                                 999
         12        SEND_VAL                                                 1337
         13        DO_FCALL                                      0  $7      
         14        ASSIGN                                                   !1, $7
   13    15      > FE_RESET_R                                       $9      !1, ->21
         16    > > FE_FETCH_R                                               $9, !2, ->21
   14    17    >   INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                                 
   13    20      > JMP                                                      ->16
         21    >   FE_FREE                                                  $9
   15    22      > RETURN                                                   1

Function formatnumbers:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 10
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 10
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 10
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 10
filename:       /in/WlBFJ
function name:  formatNumbers
number of ops:  12
compiled vars:  !0 = $formatter, !1 = $numbers, !2 = $number
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV_VARIADIC                                    !1      
          2        GENERATOR_CREATE                                         
    4     3      > FE_RESET_R                                       $3      !1, ->10
          4    > > FE_FETCH_R                                               $3, !2, ->10
    5     5    >   INIT_METHOD_CALL                                         !0, 'format'
          6        SEND_VAR_EX                                              !2
          7        DO_FCALL                                      0  $4      
          8        YIELD                                                    $4
    4     9      > JMP                                                      ->4
         10    >   FE_FREE                                                  $3
    7    11      > GENERATOR_RETURN                                         

End of function formatnumbers

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.92 ms | 1403 KiB | 16 Q