3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function test() { $chars = '0123456789abcdefghijklmnopqrstuvwxyz'; $base = mt_rand(2, 36); $len = mt_rand(10, 100); $str = ''; for ($i = 0; $i < $len; ++$i) { $str .= $chars[mt_rand(0, $base - 1)]; } $gmp = gmp_init($str, $base); $val = gmp_strval($str, $base); $val = str_pad($val, strlen($str), '0', STR_PAD_LEFT); if ($val !== $str) { throw new Exception('Not same - base '.$base."\n-".$str."\n+".$val); } } for($i = 0; $i < 100000; ++$i) { test(); }
based on oLNjU
Output for 7.1.0
Warning: gmp_strval(): Unable to convert variable to GMP - string is not an integer in /in/8jaLo on line 11 Fatal error: Uncaught Exception: Not same - base 36 -p494w4ktuqup4meov1so38h9j5k1je2r5zy9xwxd7g0s6l2j +000000000000000000000000000000000000000000000000 in /in/8jaLo:14 Stack trace: #0 /in/8jaLo(19): test() #1 {main} thrown in /in/8jaLo on line 14
Process exited with code 255.
Output for 7.0.14
Warning: gmp_strval(): Unable to convert variable to GMP - string is not an integer in /in/8jaLo on line 11 Fatal error: Uncaught Exception: Not same - base 28 -pmnl25j0km1ddhkhn56d0hcnlo8o9e8l9f12nb8gog0 +0000000000000000000000000000000000000000000 in /in/8jaLo:14 Stack trace: #0 /in/8jaLo(19): test() #1 {main} thrown in /in/8jaLo on line 14
Process exited with code 255.
Output for 7.0.6
Fatal error: Uncaught Error: Call to undefined function gmp_init() in /in/8jaLo:10 Stack trace: #0 /in/8jaLo(19): test() #1 {main} thrown in /in/8jaLo on line 10
Process exited with code 255.
Output for 7.0.5
Warning: gmp_strval(): Unable to convert variable to GMP - string is not an integer in /in/8jaLo on line 11 Fatal error: Uncaught Exception: Not same - base 27 -f8e225i00cn9e9daoa95jqo8i1kel459i2q96ldba +00000000000000000000000000000000000000000 in /in/8jaLo:14 Stack trace: #0 /in/8jaLo(19): test() #1 {main} thrown in /in/8jaLo on line 14
Process exited with code 255.
Output for 7.0.4
Warning: gmp_strval(): Unable to convert variable to GMP - string is not an integer in /in/8jaLo on line 11 Fatal error: Uncaught Exception: Not same - base 29 -pde6o6f2nr4bn3265l61bd17nia1gn8m8f57mbb1k17k42g0hja0qomkia2gf6e860dmrnch +000000000000000000000000000000000000000000000000000000000000000000000000 in /in/8jaLo:14 Stack trace: #0 /in/8jaLo(19): test() #1 {main} thrown in /in/8jaLo on line 14
Process exited with code 255.
Output for 7.0.3
Warning: gmp_strval(): Unable to convert variable to GMP - string is not an integer in /in/8jaLo on line 11 Fatal error: Uncaught Exception: Not same - base 31 -6h1frfque425i5c0j7blua5olm3hjgnf5okp8o3gpi6uas7u263c437hi9lrilj00nmff8toq9mb3a5p1709q50q2 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 in /in/8jaLo:14 Stack trace: #0 /in/8jaLo(19): test() #1 {main} thrown in /in/8jaLo on line 14
Process exited with code 255.
Output for 7.0.2
Fatal error: Uncaught Exception: Not same - base 2 -11110111111000110111010111101000100000001 +10000010100110010100011001000101000010000100101011010111101101110100010001111000000010111100011111100001011100011011101011000100000001 in /in/8jaLo:14 Stack trace: #0 /in/8jaLo(19): test() #1 {main} thrown in /in/8jaLo on line 14
Process exited with code 255.
Output for 7.0.1
Warning: gmp_strval(): Unable to convert variable to GMP - string is not an integer in /in/8jaLo on line 11 Fatal error: Uncaught Exception: Not same - base 35 -6t0gfudyw4oh4vqcq1fxh1o7n1rfxhxeguvyqm6d9h76u +000000000000000000000000000000000000000000000 in /in/8jaLo:14 Stack trace: #0 /in/8jaLo(19): test() #1 {main} thrown in /in/8jaLo on line 14
Process exited with code 255.
Output for 7.0.0
Warning: gmp_strval(): Unable to convert variable to GMP - string is not an integer in /in/8jaLo on line 11 Fatal error: Uncaught Exception: Not same - base 29 -rb7sbb3na7d6ck6chlhar3s54nj1ndh5sfbp6kddib6pij1griib10s8rn0q5mcjokqs58h5nofmqq8le13h6d98h82g +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 in /in/8jaLo:14 Stack trace: #0 /in/8jaLo(19): test() #1 {main} thrown in /in/8jaLo on line 14
Process exited with code 255.
Output for hhvm-3.12.0
Warning: gmp_strval(): Unable to convert variable to GMP - string is not an integer in /in/8jaLo on line 11 Fatal error: Uncaught exception 'Exception' with message 'Not same - base 17 -0g0e7953e8cbe1bc0e68c34a8b047c1133b81565642ag03b820b8ff571147e9cf2698d15ae7e5389e84cee3036d08 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' in /in/8jaLo:14 Stack trace: #0 /in/8jaLo(19): test() #1 {main}
Process exited with code 255.
Output for hhvm-3.10.0
Fatal error: Uncaught exception 'Exception' with message 'Not same - base 9 -8871044885 +24806382758' in /in/8jaLo:14 Stack trace: #0 /in/8jaLo(19): test() #1 {main}
Process exited with code 255.
Output for 5.6.28
Warning: gmp_strval(): Unable to convert variable to GMP - string is not an integer in /in/8jaLo on line 11 Fatal error: Uncaught exception 'Exception' with message 'Not same - base 32 -h52arv2fdjq6793cd01p0qn0450ujeor4ksj8d5qmnoa65971pdjemsffh4jhvkc +0000000000000000000000000000000000000000000000000000000000000000' in /in/8jaLo:14 Stack trace: #0 /in/8jaLo(19): test() #1 {main} thrown in /in/8jaLo on line 14
Process exited with code 255.
Output for 5.0.0 - 5.4.32, 5.5.35, 5.6.21
Fatal error: Call to undefined function gmp_init() in /in/8jaLo on line 10
Process exited with code 255.
Output for 5.6.20
Warning: gmp_strval(): Unable to convert variable to GMP - string is not an integer in /in/8jaLo on line 11 Fatal error: Uncaught exception 'Exception' with message 'Not same - base 12 -632673a5205932b43312a265358b884215096864b51518a71173950544308137a66018bb68 +00000000000000000000000000000000000000000000000000000000000000000000000000' in /in/8jaLo:14 Stack trace: #0 /in/8jaLo(19): test() #1 {main} thrown in /in/8jaLo on line 14
Process exited with code 255.
Output for 5.6.19
Warning: gmp_strval(): Unable to convert variable to GMP - string is not an integer in /in/8jaLo on line 11 Fatal error: Uncaught exception 'Exception' with message 'Not same - base 31 -2778p48ca8g17p0kkg9p8h2no97o8hlue177nlipf6l67cso +000000000000000000000000000000000000000000000000' in /in/8jaLo:14 Stack trace: #0 /in/8jaLo(19): test() #1 {main} thrown in /in/8jaLo on line 14
Process exited with code 255.
Output for 5.6.18
Warning: gmp_strval(): Unable to convert variable to GMP - string is not an integer in /in/8jaLo on line 11 Fatal error: Uncaught exception 'Exception' with message 'Not same - base 23 -bie508d3e8i1i3b38mlf0e8ilc2b68ji43gc7b5l7m3hal96k6ddgiaidladhb5j9014lgg96e5ma1kak47 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000' in /in/8jaLo:14 Stack trace: #0 /in/8jaLo(19): test() #1 {main} thrown in /in/8jaLo on line 14
Process exited with code 255.
Output for 5.6.17
Warning: gmp_strval(): Unable to convert variable to GMP - string is not an integer in /in/8jaLo on line 11 Fatal error: Uncaught exception 'Exception' with message 'Not same - base 25 -d0eke1bi3jhejom9mnnff69a1m23di8210k6b4kbiik6o340c4f0e3dk9i70cgn507lh3e +0000000000000000000000000000000000000000000000000000000000000000000000' in /in/8jaLo:14 Stack trace: #0 /in/8jaLo(19): test() #1 {main} thrown in /in/8jaLo on line 14
Process exited with code 255.
Output for 5.6.16
Fatal error: Uncaught exception 'Exception' with message 'Not same - base 5 -4402004024341444012134443420303312341223443030200230101421104132304322122122 +1203240401230103302311034402021303423433313413333121434443233041243413131012104124433341141312133222430401442' in /in/8jaLo:14 Stack trace: #0 /in/8jaLo(19): test() #1 {main} thrown in /in/8jaLo on line 14
Process exited with code 255.
Output for 5.6.15
Warning: gmp_strval(): Unable to convert variable to GMP - string is not an integer in /in/8jaLo on line 11 Fatal error: Uncaught exception 'Exception' with message 'Not same - base 33 -7ht2gn4q904g0t3q47 +000000000000000000' in /in/8jaLo:14 Stack trace: #0 /in/8jaLo(19): test() #1 {main} thrown in /in/8jaLo on line 14
Process exited with code 255.
Output for 5.6.14
Warning: gmp_strval(): Unable to convert variable to GMP - string is not an integer in /in/8jaLo on line 11 Fatal error: Uncaught exception 'Exception' with message 'Not same - base 13 -29537b740036222457414993a506100639584a3971cbc662843cc56b98196cb27ca04916775 +000000000000000000000000000000000000000000000000000000000000000000000000000' in /in/8jaLo:14 Stack trace: #0 /in/8jaLo(19): test() #1 {main} thrown in /in/8jaLo on line 14
Process exited with code 255.
Output for 5.6.13
Warning: gmp_strval(): Unable to convert variable to GMP - string is not an integer in /in/8jaLo on line 11 Fatal error: Uncaught exception 'Exception' with message 'Not same - base 20 -a7ji3jgb09chi3g4i50jah792gj0c0da2h5jdbdcd3b97b5gfi1119fafhdh880jhdg85a0298g103eih7bbg0 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000' in /in/8jaLo:14 Stack trace: #0 /in/8jaLo(19): test() #1 {main} thrown in /in/8jaLo on line 14
Process exited with code 255.
Output for 5.6.12
Warning: gmp_strval(): Unable to convert variable to GMP - string is not an integer in /in/8jaLo on line 11 Fatal error: Uncaught exception 'Exception' with message 'Not same - base 32 -ev4fsiqastca9m969g23fip10tqakmh2pm8u2gj2tsigo3aki0h8c4 +000000000000000000000000000000000000000000000000000000' in /in/8jaLo:14 Stack trace: #0 /in/8jaLo(19): test() #1 {main} thrown in /in/8jaLo on line 14
Process exited with code 255.
Output for 5.6.11
Fatal error: Uncaught exception 'Exception' with message 'Not same - base 9 -671275374484516754070806565 +12480453425266566157755004266' in /in/8jaLo:14 Stack trace: #0 /in/8jaLo(19): test() #1 {main} thrown in /in/8jaLo on line 14
Process exited with code 255.
Output for 5.6.10
Fatal error: Uncaught exception 'Exception' with message 'Not same - base 5 -2403334410132412030344020340112223324214200202100234024411403112244124202323010042114421020 +1304211304142310434243222204431420224111114403004442143330202420240343240021233224130414303024442112311343100023033012222242433040' in /in/8jaLo:14 Stack trace: #0 /in/8jaLo(19): test() #1 {main} thrown in /in/8jaLo on line 14
Process exited with code 255.
Output for 5.6.9
Fatal error: Uncaught exception 'Exception' with message 'Not same - base 5 -01230223142332410313014142030041013231014042301032311233111303221102240314143 +10232403140010111410333201212012403321021232321412121041031044200214310120340323132312102020213304' in /in/8jaLo:14 Stack trace: #0 /in/8jaLo(19): test() #1 {main} thrown in /in/8jaLo on line 14
Process exited with code 255.
Output for 5.6.8
Warning: gmp_strval(): Unable to convert variable to GMP - string is not an integer in /in/8jaLo on line 11 Fatal error: Uncaught exception 'Exception' with message 'Not same - base 18 -e0dhccd4443c2fa7c +00000000000000000' in /in/8jaLo:14 Stack trace: #0 /in/8jaLo(19): test() #1 {main} thrown in /in/8jaLo on line 14
Process exited with code 255.
Output for 5.5.34
Fatal error: Uncaught exception 'Exception' with message 'Not same - base 36 -kx7rcghdb0if7w8tquq2lilngsf0bovmmujl6gkw6kt4ite8ykrrzna4o50nt5yfh8yhkf93lwd9gdbx6r +0000000000000000000000000000000000000000000000000000000000000000000000000000000000' in /in/8jaLo:14 Stack trace: #0 /in/8jaLo(19): test() #1 {main} thrown in /in/8jaLo on line 14
Process exited with code 255.
Output for 5.5.33
Fatal error: Uncaught exception 'Exception' with message 'Not same - base 6 -1433322313041544350135 +1222254133231501555443140223' in /in/8jaLo:14 Stack trace: #0 /in/8jaLo(19): test() #1 {main} thrown in /in/8jaLo on line 14
Process exited with code 255.
Output for 5.5.32
Fatal error: Uncaught exception 'Exception' with message 'Not same - base 29 -rjn8f6ci8imp9j2gl +00000000000000000' in /in/8jaLo:14 Stack trace: #0 /in/8jaLo(19): test() #1 {main} thrown in /in/8jaLo on line 14
Process exited with code 255.
Output for 5.5.31
Fatal error: Uncaught exception 'Exception' with message 'Not same - base 18 -bhf30g006h9bgbc329 +000000000000000000' in /in/8jaLo:14 Stack trace: #0 /in/8jaLo(19): test() #1 {main} thrown in /in/8jaLo on line 14
Process exited with code 255.
Output for 5.5.30
Fatal error: Uncaught exception 'Exception' with message 'Not same - base 21 -02b766c271082egkfj81kc22i8266a2af202jea53a5hk3dj8ed9k013cgf63656j4322kch9f9fj8ejj +000000000000000000000000000000000000000000000000000000000000000000000000000000000' in /in/8jaLo:14 Stack trace: #0 /in/8jaLo(19): test() #1 {main} thrown in /in/8jaLo on line 14
Process exited with code 255.
Output for 5.5.29
Fatal error: Uncaught exception 'Exception' with message 'Not same - base 25 -d8bgieh2lhmjngak37him8l6hokdhdiika4 +00000000000000000000000000000000000' in /in/8jaLo:14 Stack trace: #0 /in/8jaLo(19): test() #1 {main} thrown in /in/8jaLo on line 14
Process exited with code 255.
Output for 5.5.28
Fatal error: Uncaught exception 'Exception' with message 'Not same - base 35 -kxw5knw7962 +00000000000' in /in/8jaLo:14 Stack trace: #0 /in/8jaLo(19): test() #1 {main} thrown in /in/8jaLo on line 14
Process exited with code 255.
Output for 5.5.27
Fatal error: Uncaught exception 'Exception' with message 'Not same - base 8 -375762443612111402732421473344122425462100664745574277636206366627445253221142025124306 +602664064573252735575760516364613453636336107130316151376701750211517301067575276441562456534722' in /in/8jaLo:14 Stack trace: #0 /in/8jaLo(19): test() #1 {main} thrown in /in/8jaLo on line 14
Process exited with code 255.
Output for 5.5.26
Fatal error: Uncaught exception 'Exception' with message 'Not same - base 25 -lc22ni30oj9ad6517443fgb9n791njimc7l2k9l7i94n450gdie325mg0e16ddcfcomikbhicl78e500 +00000000000000000000000000000000000000000000000000000000000000000000000000000000' in /in/8jaLo:14 Stack trace: #0 /in/8jaLo(19): test() #1 {main} thrown in /in/8jaLo on line 14
Process exited with code 255.
Output for 5.5.25
Fatal error: Uncaught exception 'Exception' with message 'Not same - base 19 -b22d579hh7e206ideghg83aea22dg9i4 +00000000000000000000000000000000' in /in/8jaLo:14 Stack trace: #0 /in/8jaLo(19): test() #1 {main} thrown in /in/8jaLo on line 14
Process exited with code 255.
Output for 5.5.24
Fatal error: Uncaught exception 'Exception' with message 'Not same - base 26 -bn43mfka8bo8772ii7lcimfmk9ga1i46p4 +0000000000000000000000000000000000' in /in/8jaLo:14 Stack trace: #0 /in/8jaLo(19): test() #1 {main} thrown in /in/8jaLo on line 14
Process exited with code 255.
Output for 5.4.45
Fatal error: Uncaught exception 'Exception' with message 'Not same - base 25 -hgmlke3ikeemacd7o4n077nn +000000000000000000000000' in /in/8jaLo:14 Stack trace: #0 /in/8jaLo(19): test() #1 {main} thrown in /in/8jaLo on line 14
Process exited with code 255.
Output for 5.4.44
Fatal error: Uncaught exception 'Exception' with message 'Not same - base 20 -c01faj4115e8iaacbg617gjf3jid59ah1fi4he7h02f2 +00000000000000000000000000000000000000000000' in /in/8jaLo:14 Stack trace: #0 /in/8jaLo(19): test() #1 {main} thrown in /in/8jaLo on line 14
Process exited with code 255.
Output for 5.4.43
Fatal error: Uncaught exception 'Exception' with message 'Not same - base 28 -5905aqckrdd16cqhr3lnp49p5b1bii02gqmgo0mhbok32lje7r5f7r3n5r3odc698r +000000000000000000000000000000000000000000000000000000000000000000' in /in/8jaLo:14 Stack trace: #0 /in/8jaLo(19): test() #1 {main} thrown in /in/8jaLo on line 14
Process exited with code 255.
Output for 5.4.42
Fatal error: Uncaught exception 'Exception' with message 'Not same - base 23 -43be58i8dhb12m7l9fek7gk3c5hfa3f1g26b389201b5g +000000000000000000000000000000000000000000000' in /in/8jaLo:14 Stack trace: #0 /in/8jaLo(19): test() #1 {main} thrown in /in/8jaLo on line 14
Process exited with code 255.
Output for 5.4.41
Fatal error: Uncaught exception 'Exception' with message 'Not same - base 12 -785321b36219851905ab239a298a199bb3ab07811a948241ab420bbb49497679a3 +000000000000000000000000000000000000000000000000000000000000000000' in /in/8jaLo:14 Stack trace: #0 /in/8jaLo(19): test() #1 {main} thrown in /in/8jaLo on line 14
Process exited with code 255.
Output for 5.4.40
Fatal error: Uncaught exception 'Exception' with message 'Not same - base 21 -b4h4cbk76d0k8755dii806a2e5ciakj6f69c8c36k850g5i +00000000000000000000000000000000000000000000000' in /in/8jaLo:14 Stack trace: #0 /in/8jaLo(19): test() #1 {main} thrown in /in/8jaLo on line 14
Process exited with code 255.
Output for 5.4.39
Fatal error: Uncaught exception 'Exception' with message 'Not same - base 12 -11ab0bb35062266744a6a20082472634b720a +0000000000000000000000000000000000000' in /in/8jaLo:14 Stack trace: #0 /in/8jaLo(19): test() #1 {main} thrown in /in/8jaLo on line 14
Process exited with code 255.
Output for 5.4.38
Fatal error: Uncaught exception 'Exception' with message 'Not same - base 27 -0hl6c18d4hm0fcpm57jamib0nij944nbq71 +00000000000000000000000000000000000' in /in/8jaLo:14 Stack trace: #0 /in/8jaLo(19): test() #1 {main} thrown in /in/8jaLo on line 14
Process exited with code 255.
Output for 5.4.37
Fatal error: Uncaught exception 'Exception' with message 'Not same - base 19 -d8bda328g440bf2h4aae4feafg833420 +00000000000000000000000000000000' in /in/8jaLo:14 Stack trace: #0 /in/8jaLo(19): test() #1 {main} thrown in /in/8jaLo on line 14
Process exited with code 255.
Output for 5.4.36
Fatal error: Uncaught exception 'Exception' with message 'Not same - base 3 -222120200111221212112020000110121011111022022211111010002 +10100002220222120111202122011012100212212222211001202000102120210100022002010111112010112001101001220221002020111002012' in /in/8jaLo:14 Stack trace: #0 /in/8jaLo(19): test() #1 {main} thrown in /in/8jaLo on line 14
Process exited with code 255.
Output for 5.4.35
Fatal error: Uncaught exception 'Exception' with message 'Not same - base 14 -80daba59356d9d88d8132d450745 +0000000000000000000000000000' in /in/8jaLo:14 Stack trace: #0 /in/8jaLo(19): test() #1 {main} thrown in /in/8jaLo on line 14
Process exited with code 255.
Output for 5.4.34
Fatal error: Uncaught exception 'Exception' with message 'Not same - base 36 -5pdn1amr7y0l +000000000000' in /in/8jaLo:14 Stack trace: #0 /in/8jaLo(19): test() #1 {main} thrown in /in/8jaLo on line 14
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_NEW in /in/8jaLo on line 14
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_NEW in /in/8jaLo on line 14
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/8jaLo on line 14
Process exited with code 255.