3v4l.org

run code in 300+ PHP versions simultaneously
<?php $new_file_name = "foto.jpeg"; if(substr(strtolower($new_file_name), -4) == "jpeg") { $new_file_name = substr($new_file_name, 0, -4) . 'jpg'; } echo $new_file_name;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 17
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/9eTtV
function name:  (null)
number of ops:  19
compiled vars:  !0 = $new_file_name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'foto.jpeg'
    5     1        INIT_FCALL                                               'substr'
          2        INIT_FCALL                                               'strtolower'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $2      
          5        SEND_VAR                                                 $2
          6        SEND_VAL                                                 -4
          7        DO_ICALL                                         $3      
          8        IS_EQUAL                                                 $3, 'jpeg'
          9      > JMPZ                                                     ~4, ->17
    6    10    >   INIT_FCALL                                               'substr'
         11        SEND_VAR                                                 !0
         12        SEND_VAL                                                 0
         13        SEND_VAL                                                 -4
         14        DO_ICALL                                         $5      
         15        CONCAT                                           ~6      $5, 'jpg'
         16        ASSIGN                                                   !0, ~6
   10    17    >   ECHO                                                     !0
   11    18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.96 ms | 1395 KiB | 17 Q