3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<HTML <figure data-trix-attachment="{&quot;content&quot;:&quot;<span class=\&quot;trix-token\&quot; data-token-id=\&quot;landlord_name\&quot;>Jméno pronajímatele</span>&quot;}" data-trix-content-type="undefined" class="attachment attachment--content"><span class="trix-token">Jméno pronajímatele</span><figcaption class="attachment__caption"></figcaption></figure> HTML; $figureOpenTagPattern = \sprintf('<figure data-token-id="%s"[^>]*>', $token->name); $figureOpenTagReplacement = \sprintf('<figure data-token-id="%s">', $token->name); $figureEndTag = '<\/figure>'; $html = \preg_replace( '/' . $figureOpenTagPattern . '(.+)' . $figureEndTag . '/U', $figureOpenTagReplacement . \sprintf('<span class="trix-token %s %s" data-token-id="%s">%s</span>', $token->name, $tokenClass, $token->name, $token->value) . '</figure>', $html, ); echo $html;
Output for 8.4.1 - 8.4.14, 8.4.16, 8.5.0 - 8.5.1
Warning: Undefined variable $token in /in/QmJR6 on line 5 Warning: Attempt to read property "name" on null in /in/QmJR6 on line 5 Warning: Undefined variable $token in /in/QmJR6 on line 6 Warning: Attempt to read property "name" on null in /in/QmJR6 on line 6 Warning: Undefined variable $token in /in/QmJR6 on line 10 Warning: Attempt to read property "name" on null in /in/QmJR6 on line 10 Warning: Undefined variable $token in /in/QmJR6 on line 10 Warning: Attempt to read property "name" on null in /in/QmJR6 on line 10 Warning: Undefined variable $token in /in/QmJR6 on line 10 Warning: Attempt to read property "value" on null in /in/QmJR6 on line 10 Warning: Undefined variable $tokenClass in /in/QmJR6 on line 10 <figure data-trix-attachment="{&quot;content&quot;:&quot;<span class=\&quot;trix-token\&quot; data-token-id=\&quot;landlord_name\&quot;>Jméno pronajímatele</span>&quot;}" data-trix-content-type="undefined" class="attachment attachment--content"><span class="trix-token">Jméno pronajímatele</span><figcaption class="attachment__caption"></figcaption></figure>
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.
Output for 8.3.28
/bin/php-8.3.28: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.3.28) /bin/php-8.3.28: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.3.28) /bin/php-8.3.28: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.3.28) /bin/php-8.3.28: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.3.28)
Process exited with code 1.
Output for 8.2.0 - 8.2.29, 8.3.0 - 8.3.27
Warning: Undefined variable $token in /in/QmJR6 on line 5 Warning: Attempt to read property "name" on null in /in/QmJR6 on line 5 Warning: Undefined variable $token in /in/QmJR6 on line 6 Warning: Attempt to read property "name" on null in /in/QmJR6 on line 6 Warning: Undefined variable $token in /in/QmJR6 on line 10 Warning: Attempt to read property "name" on null in /in/QmJR6 on line 10 Warning: Undefined variable $tokenClass in /in/QmJR6 on line 10 Warning: Undefined variable $token in /in/QmJR6 on line 10 Warning: Attempt to read property "name" on null in /in/QmJR6 on line 10 Warning: Undefined variable $token in /in/QmJR6 on line 10 Warning: Attempt to read property "value" on null in /in/QmJR6 on line 10 <figure data-trix-attachment="{&quot;content&quot;:&quot;<span class=\&quot;trix-token\&quot; data-token-id=\&quot;landlord_name\&quot;>Jméno pronajímatele</span>&quot;}" data-trix-content-type="undefined" class="attachment attachment--content"><span class="trix-token">Jméno pronajímatele</span><figcaption class="attachment__caption"></figcaption></figure>

preferences:
72.28 ms | 413 KiB | 5 Q