3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* Напиши программу, проверяющую, является ли строка палиндромом. */ $text = 'А роза упала на лапу Азора'; $result = 'палиндром'; $text = mb_strtolower($text); $text = str_replace(' ', '', $text); $length = mb_strlen($text); $halfLength = floor($length / 2); for ($i = 0; $i < $length; $i++) { $left = mb_substr($text, $i, 1); $right = mb_substr($text, -($i + 1), 1); if ($left != $right) { $result = 'не палиндром'; break; } } echo "Результат: {$result}.";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 42
Branch analysis from position: 42
2 jumps found. (Code = 44) Position 1 = 44, Position 2 = 23
Branch analysis from position: 44
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 39, Position 2 = 41
Branch analysis from position: 39
1 jumps found. (Code = 42) Position 1 = 44
Branch analysis from position: 44
Branch analysis from position: 41
2 jumps found. (Code = 44) Position 1 = 44, Position 2 = 23
Branch analysis from position: 44
Branch analysis from position: 23
filename:       /in/7F92K
function name:  (null)
number of ops:  49
compiled vars:  !0 = $text, !1 = $result, !2 = $length, !3 = $halfLength, !4 = $i, !5 = $left, !6 = $right
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, '%D0%90+%D1%80%D0%BE%D0%B7%D0%B0+%D1%83%D0%BF%D0%B0%D0%BB%D0%B0+%D0%BD%D0%B0+%D0%BB%D0%B0%D0%BF%D1%83+%D0%90%D0%B7%D0%BE%D1%80%D0%B0'
    6     1        ASSIGN                                                   !1, '%D0%BF%D0%B0%D0%BB%D0%B8%D0%BD%D0%B4%D1%80%D0%BE%D0%BC'
    8     2        INIT_FCALL                                               'mb_strtolower'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $9      
          5        ASSIGN                                                   !0, $9
   10     6        INIT_FCALL                                               'str_replace'
          7        SEND_VAL                                                 '+'
          8        SEND_VAL                                                 ''
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $11     
         11        ASSIGN                                                   !0, $11
   11    12        INIT_FCALL                                               'mb_strlen'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                         $13     
         15        ASSIGN                                                   !2, $13
   12    16        INIT_FCALL                                               'floor'
         17        DIV                                              ~15     !2, 2
         18        SEND_VAL                                                 ~15
         19        DO_ICALL                                         $16     
         20        ASSIGN                                                   !3, $16
   14    21        ASSIGN                                                   !4, 0
         22      > JMP                                                      ->42
   15    23    >   INIT_FCALL                                               'mb_substr'
         24        SEND_VAR                                                 !0
         25        SEND_VAR                                                 !4
         26        SEND_VAL                                                 1
         27        DO_ICALL                                         $19     
         28        ASSIGN                                                   !5, $19
   16    29        INIT_FCALL                                               'mb_substr'
         30        SEND_VAR                                                 !0
         31        ADD                                              ~21     !4, 1
         32        MUL                                              ~22     ~21, -1
         33        SEND_VAL                                                 ~22
         34        SEND_VAL                                                 1
         35        DO_ICALL                                         $23     
         36        ASSIGN                                                   !6, $23
   18    37        IS_NOT_EQUAL                                             !5, !6
         38      > JMPZ                                                     ~25, ->41
   19    39    >   ASSIGN                                                   !1, '%D0%BD%D0%B5+%D0%BF%D0%B0%D0%BB%D0%B8%D0%BD%D0%B4%D1%80%D0%BE%D0%BC'
   21    40      > JMP                                                      ->44
   14    41    >   PRE_INC                                                  !4
         42    >   IS_SMALLER                                               !4, !2
         43      > JMPNZ                                                    ~28, ->23
   25    44    >   ROPE_INIT                                     3  ~30     '%D0%A0%D0%B5%D0%B7%D1%83%D0%BB%D1%8C%D1%82%D0%B0%D1%82%3A+'
         45        ROPE_ADD                                      1  ~30     ~30, !1
         46        ROPE_END                                      2  ~29     ~30, '.'
         47        ECHO                                                     ~29
         48      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.96 ms | 1400 KiB | 23 Q