3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo "\n\n-【 int 123 】------------------------------------\n\n\n"; $value = 123; $res = str_pad($value, 5, 0, STR_PAD_LEFT); var_dump($res); echo "\n\n-【 string '' 】-------------------------------------\n\n\n"; $value = ''; $res = str_pad($value, 5, 0, STR_PAD_LEFT); var_dump($res); echo "\n\n-【 null 】-------------------------------------\n\n\n"; $value = null; $res = str_pad($value, 5, 0, STR_PAD_LEFT); var_dump($res); echo "\n\n-【 string AAA 】-------------------------------------\n\n\n"; $value = "AAA"; $res = str_pad($value, 5, 0, STR_PAD_LEFT); var_dump($res); echo "\n\n-【 string 漢(漢字) 】-------------------------------------\n\n\n"; $value = "漢"; $res = str_pad($value, 5, 0, STR_PAD_LEFT); var_dump($res); echo "\n\n-【 string あ(ひらがな) 】-------------------------------------\n\n\n"; $value = "あ"; $res = str_pad($value, 5, 0, STR_PAD_LEFT); var_dump($res); echo "\n\n-【 string カ(カタカナ) 】-------------------------------------\n\n\n"; $value = "カ"; $res = str_pad($value, 5, 0, STR_PAD_LEFT); var_dump($res); echo "\n\n-【 string 🍣(絵文字) 】-------------------------------------\n\n\n"; $value = "🍣"; $res = str_pad($value, 5, 0, STR_PAD_LEFT); var_dump($res); echo "\n\n-【 string 𩸽(サロゲートペア) 】-------------------------------------\n\n\n"; $value = "𩸽"; $res = str_pad($value, 5, 0, STR_PAD_LEFT); var_dump($res); echo "\n\n-【 bool true 】-------------------------------------\n\n\n"; $value = true; $res = str_pad($value, 5, 0, STR_PAD_LEFT); var_dump($res); echo "\n\n-【 bool false 】-------------------------------------\n\n\n"; $value = false; $res = str_pad($value, 5, 0, STR_PAD_LEFT); var_dump($res); echo "\n\n------------------------------------------------------\n\n\n";
Output for git.master, git.master_jit, rfc.property-hooks
-【 int 123 】------------------------------------ string(5) "00123" -【 string '' 】------------------------------------- string(5) "00000" -【 null 】------------------------------------- Deprecated: str_pad(): Passing null to parameter #1 ($string) of type string is deprecated in /in/OfEQb on line 18 string(5) "00000" -【 string AAA 】------------------------------------- string(5) "00AAA" -【 string 漢(漢字) 】------------------------------------- string(5) "00漢" -【 string あ(ひらがな) 】------------------------------------- string(5) "00あ" -【 string カ(カタカナ) 】------------------------------------- string(5) "00カ" -【 string 🍣(絵文字) 】------------------------------------- string(5) "0🍣" -【 string 𩸽(サロゲートペア) 】------------------------------------- string(5) "0𩸽" -【 bool true 】------------------------------------- string(5) "00001" -【 bool false 】------------------------------------- string(5) "00000" ------------------------------------------------------

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
191.05 ms | 409 KiB | 5 Q