3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = '$file%s = $entity->getForm%s(); if ($file%s) { $filename%s = uniqid() . \'.\' . $file%s->getClientOriginalExtension(); $this->filesystem->write($filename%s, file_get_contents($file%s->getPathname())); $entity->set%s(\'/imgs/upload/service/\' . $filename%s); }'; $elements = array( '1' => 'Photo', '2' => 'Icon', '3' => 'TopPhoto', '4' => 'DescriptionPhoto', '5' => 'BenefitPhoto', '6' => 'IndicationPhoto', '7' => 'PreparationPhoto', ); foreach ($elements as $key => $element) { echo sprintf($string, $key, $element, $key, $key, $key, $key, $key, $element, $key)."\n"."\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 21
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 21
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/R1ujN
function name:  (null)
number of ops:  23
compiled vars:  !0 = $string, !1 = $elements, !2 = $element, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%24file%25s+%3D+%24entity-%3EgetForm%25s%28%29%3B%0A++++++++++++if+%28%24file%25s%29+%7B%0A++++++++++++++++%24filename%25s+%3D+uniqid%28%29+.+%27.%27+.+%24file%25s-%3EgetClientOriginalExtension%28%29%3B%0A%0A++++++++++++++++%24this-%3Efilesystem-%3Ewrite%28%24filename%25s%2C+file_get_contents%28%24file%25s-%3EgetPathname%28%29%29%29%3B%0A%0A++++++++++++++++%24entity-%3Eset%25s%28%27%2Fimgs%2Fupload%2Fservice%2F%27+.+%24filename%25s%29%3B%0A++++++++++++%7D'
   10     1        ASSIGN                                                   !1, <array>
   20     2      > FE_RESET_R                                       $6      !1, ->21
          3    > > FE_FETCH_R                                       ~7      $6, !2, ->21
          4    >   ASSIGN                                                   !3, ~7
   21     5        INIT_FCALL                                               'sprintf'
          6        SEND_VAR                                                 !0
          7        SEND_VAR                                                 !3
          8        SEND_VAR                                                 !2
          9        SEND_VAR                                                 !3
         10        SEND_VAR                                                 !3
         11        SEND_VAR                                                 !3
         12        SEND_VAR                                                 !3
         13        SEND_VAR                                                 !3
         14        SEND_VAR                                                 !2
         15        SEND_VAR                                                 !3
         16        DO_ICALL                                         $9      
         17        CONCAT                                           ~10     $9, '%0A'
         18        CONCAT                                           ~11     ~10, '%0A'
         19        ECHO                                                     ~11
   20    20      > JMP                                                      ->3
         21    >   FE_FREE                                                  $6
   22    22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.06 ms | 1396 KiB | 15 Q