3v4l.org

run code in 500+ PHP versions simultaneously
<?php $trans = [ 'en' => [ 'user_where_are_you_text' => 'Where are You, %s? It is me, %s! I am waiting here for %s hours!', //... ], 'fr' => [ 'user_where_are_you_text' => 'Où es-tu, %s? C\'est moi, %s! J\'attends ici depuis %s heures!' //... ], ]; $name = 'Loz'; $name1 = 'Rasmus'; $time = 3; function __($key, ...$arguments) { global $trans, $lang; return sprintf($trans[$lang][$key], ...$arguments); } // $lang = 'en'; echo __('user_where_are_you_text', $name, $name1, $time).PHP_EOL; // $lang = 'fr'; echo __('user_where_are_you_text', $name, $name1, $time).PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/e1nEB
function name:  (null)
number of ops:  23
compiled vars:  !0 = $trans, !1 = $name, !2 = $name1, !3 = $time, !4 = $lang
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, <array>
   13     1        ASSIGN                                                       !1, 'Loz'
   14     2        ASSIGN                                                       !2, 'Rasmus'
   15     3        ASSIGN                                                       !3, 3
   23     4        ASSIGN                                                       !4, 'en'
   24     5        INIT_FCALL                                                   '__'
          6        SEND_VAL                                                     'user_where_are_you_text'
          7        SEND_VAR                                                     !1
          8        SEND_VAR                                                     !2
          9        SEND_VAR                                                     !3
         10        DO_FCALL                                          0  $10     
         11        CONCAT                                               ~11     $10, '%0A'
         12        ECHO                                                         ~11
   27    13        ASSIGN                                                       !4, 'fr'
   28    14        INIT_FCALL                                                   '__'
         15        SEND_VAL                                                     'user_where_are_you_text'
         16        SEND_VAR                                                     !1
         17        SEND_VAR                                                     !2
         18        SEND_VAR                                                     !3
         19        DO_FCALL                                          0  $13     
         20        CONCAT                                               ~14     $13, '%0A'
         21        ECHO                                                         ~14
   29    22      > RETURN                                                       1

Function __:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/e1nEB
function name:  __
number of ops:  13
compiled vars:  !0 = $key, !1 = $arguments, !2 = $trans, !3 = $lang
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   17     0  E >   RECV                                                 !0      
          1        RECV_VARIADIC                                        !1      
   18     2        BIND_GLOBAL                                                  !2, 'trans'
          3        BIND_GLOBAL                                                  !3, 'lang'
   19     4        INIT_FCALL                                                   'sprintf'
          5        FETCH_DIM_R                                          ~4      !2, !3
          6        FETCH_DIM_R                                          ~5      ~4, !0
          7        SEND_VAL                                                     ~5
          8        SEND_UNPACK                                                  !1
          9        CHECK_UNDEF_ARGS                                             
         10        DO_ICALL                                             $6      
         11      > RETURN                                                       $6
   20    12*     > RETURN                                                       null

End of function __

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
164.02 ms | 2165 KiB | 16 Q