3v4l.org

run code in 300+ PHP versions simultaneously
<?php $mce_init = array( 'plugins' => '', 'toolbar1' => '' ); $mce_init['plugins'] .= ',directionality'; $mce_init['toolbar1'] .= ',ltr'; // All is OK: print_r( $mce_init ); unset( $mce_init['plugins'], $mce_init['toolbar1'] ); // Triggers a warning in PHP 5.2.17: $mce_init['plugins'] .= ',directionality'; $mce_init['toolbar1'] .= ',ltr'; print_r( $mce_init ); // Should trigger the reported fatal in https://core.trac.wordpress.org/ticket/45482; $mce_init = 'string'; // '', array(), new stdClass, null, false, etc do not trigger the specific fatal. $mce_init['plugins'] .= ',directionality'; $mce_init['toolbar1'] .= ',ltr'; print_r( $mce_init );
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
Array ( [plugins] => ,directionality [toolbar1] => ,ltr ) Warning: Undefined array key "plugins" in /in/ZVCKP on line 14 Warning: Undefined array key "toolbar1" in /in/ZVCKP on line 15 Array ( [plugins] => ,directionality [toolbar1] => ,ltr ) Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /in/ZVCKP:22 Stack trace: #0 {main} thrown in /in/ZVCKP on line 22
Process exited with code 255.
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 Array ( [plugins] => ,directionality [toolbar1] => ,ltr ) Warning: Undefined array key "plugins" in /in/ZVCKP on line 14 Warning: Undefined array key "toolbar1" in /in/ZVCKP on line 15 Array ( [plugins] => ,directionality [toolbar1] => ,ltr ) Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /in/ZVCKP:22 Stack trace: #0 {main} thrown in /in/ZVCKP on line 22
Process exited with code 255.
Output for 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.16 - 7.3.31, 7.4.0 - 7.4.33
Array ( [plugins] => ,directionality [toolbar1] => ,ltr ) Notice: Undefined index: plugins in /in/ZVCKP on line 14 Notice: Undefined index: toolbar1 in /in/ZVCKP on line 15 Array ( [plugins] => ,directionality [toolbar1] => ,ltr ) Warning: Illegal string offset 'plugins' in /in/ZVCKP on line 22 Fatal error: Uncaught Error: Cannot use assign-op operators with string offsets in /in/ZVCKP:22 Stack trace: #0 {main} thrown in /in/ZVCKP on line 22
Process exited with code 255.
Output for 7.3.32 - 7.3.33
Array ( [plugins] => ,directionality [toolbar1] => ,ltr ) Array ( [plugins] => ,directionality [toolbar1] => ,ltr ) Warning: Illegal string offset 'plugins' in /in/ZVCKP on line 22 Fatal error: Uncaught Error: Cannot use assign-op operators with string offsets in /in/ZVCKP:22 Stack trace: #0 {main} thrown in /in/ZVCKP on line 22
Process exited with code 255.
Output for 7.0.0 - 7.0.33
Array ( [plugins] => ,directionality [toolbar1] => ,ltr ) Notice: Undefined index: plugins in /in/ZVCKP on line 14 Notice: Undefined index: toolbar1 in /in/ZVCKP on line 15 Array ( [plugins] => ,directionality [toolbar1] => ,ltr ) Warning: Illegal string offset 'plugins' in /in/ZVCKP on line 22 Fatal error: Uncaught Error: Cannot use assign-op operators with overloaded objects nor string offsets in /in/ZVCKP:22 Stack trace: #0 {main} thrown in /in/ZVCKP on line 22
Process exited with code 255.
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.38
Array ( [plugins] => ,directionality [toolbar1] => ,ltr ) Notice: Undefined index: plugins in /in/ZVCKP on line 14 Notice: Undefined index: toolbar1 in /in/ZVCKP on line 15 Array ( [plugins] => ,directionality [toolbar1] => ,ltr ) Warning: Illegal string offset 'plugins' in /in/ZVCKP on line 22 Fatal error: Cannot use assign-op operators with overloaded objects nor string offsets in /in/ZVCKP on line 22
Process exited with code 255.
Output for 5.3.0 - 5.3.29
Array ( [plugins] => ,directionality [toolbar1] => ,ltr ) Notice: Undefined index: plugins in /in/ZVCKP on line 14 Notice: Undefined index: toolbar1 in /in/ZVCKP on line 15 Array ( [plugins] => ,directionality [toolbar1] => ,ltr ) Fatal error: Cannot use assign-op operators with overloaded objects nor string offsets in /in/ZVCKP on line 22
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17
Array ( [plugins] => ,directionality [toolbar1] => ,ltr ) Notice: Undefined index: plugins in /in/ZVCKP on line 14 Notice: Undefined index: toolbar1 in /in/ZVCKP on line 15 Array ( [plugins] => ,directionality [toolbar1] => ,ltr ) Fatal error: Cannot use assign-op operators with overloaded objects nor string offsets in /in/ZVCKP on line 22
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Array ( [plugins] => ,directionality [toolbar1] => ,ltr ) Notice: Undefined index: plugins in /in/ZVCKP on line 14 Notice: Undefined index: toolbar1 in /in/ZVCKP on line 15 Array ( [plugins] => ,directionality [toolbar1] => ,ltr ) Fatal error: Cannot use assign-op operators with overloaded objects nor string offsets in /in/ZVCKP on line 22

preferences:
290.43 ms | 402 KiB | 417 Q