3v4l.org

run code in 300+ PHP versions simultaneously
<?php $matiere1 = 'Cotton 2'; $matiere2 = 'lol'; echo "Matiere1 : ".checkMatiere($matiere1)." - Matiere2 : ".checkMatiere($matiere2); function checkMatiere($matiere){ $matiere = strtolower($matiere); switch ($matiere) { case (strpos($matiere, 'cotton') !== FALSE): $matiere = 'coton'; break; default: $matiere = "KO"; break; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/N02ss
function name:  (null)
number of ops:  13
compiled vars:  !0 = $matiere1, !1 = $matiere2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'Cotton+2'
    4     1        ASSIGN                                                   !1, 'lol'
    6     2        INIT_FCALL_BY_NAME                                       'checkMatiere'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0  $4      
          5        CONCAT                                           ~5      'Matiere1+%3A+', $4
          6        CONCAT                                           ~6      ~5, '+-+Matiere2+%3A+'
          7        INIT_FCALL_BY_NAME                                       'checkMatiere'
          8        SEND_VAR_EX                                              !1
          9        DO_FCALL                                      0  $7      
         10        CONCAT                                           ~8      ~6, $7
         11        ECHO                                                     ~8
   19    12      > RETURN                                                   1

Function checkmatiere:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 13
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
filename:       /in/N02ss
function name:  checkMatiere
number of ops:  18
compiled vars:  !0 = $matiere
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     1        INIT_FCALL                                               'strtolower'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4        ASSIGN                                                   !0, $1
   11     5        INIT_FCALL                                               'strpos'
          6        SEND_VAR                                                 !0
          7        SEND_VAL                                                 'cotton'
          8        DO_ICALL                                         $4      
   10     9        TYPE_CHECK                                  1018  ~5      $4
         10        IS_EQUAL                                                 !0, ~5
         11      > JMPNZ                                                    ~3, ->13
         12    > > JMP                                                      ->15
   12    13    >   ASSIGN                                                   !0, 'coton'
   13    14      > JMP                                                      ->17
   16    15    >   ASSIGN                                                   !0, 'KO'
   17    16      > JMP                                                      ->17
   19    17    > > RETURN                                                   null

End of function checkmatiere

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.43 ms | 1396 KiB | 17 Q