3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $data = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris urna sem, aliquet pharetra ipsum ut, porta euismod turpis. Cras rhoncus quis felis tincidunt bibendum. Curabitur vitae enim nec augue tempor consequat a id velit. Proin eget tortor sagittis, pulvinar tellus elementum, ultricies enim. Duis auctor justo in sem gravida lacinia. Praesent nisl massa, hendrerit ac risus in, ornare facilisis lacus. Donec eget elit nec sapien feugiat faucibus. Maecenas eu elit enim. Aenean dictum mattis leo at luctus. Pellentesque sit amet erat et elit vehicula porta. Cras tempus diam quis lectus vulputate lacinia. Sed nisi est, accumsan dignissim blandit nec, eleifend non dolor. Nam interdum molestie nulla, vel ultrices quam interdum lacinia. Duis non viverra quam, at convallis leo. Mauris pulvinar nunc a metus semper tempor. Proin felis erat, ornare id ligula sit amet, rutrum mattis lorem. Sed non diam eget felis auctor pellentesque nec eu metus. In in nibh et libero vehicula vehicula. Maecenas sed turpis sed ante lobortis interdum ac quis mi. Pellentesque semper mi quis placerat aliquet. Duis ac diam convallis, volutpat erat ut, hendrerit felis. Pellentesque et turpis nisi. Sed consequat laoreet sapien quis sagittis. Ut a libero at justo sodales pellentesque id vitae est. Nulla scelerisque eros nec mi porta, at congue eros malesuada. Aliquam erat volutpat. Aliquam libero libero, imperdiet vitae metus vitae, dignissim facilisis risus. Quisque tempus eleifend neque, ut suscipit tellus aliquam at. Suspendisse sodales orci hendrerit, ornare elit in, rhoncus ante. Cras euismod consectetur justo non blandit. Mauris pulvinar vehicula libero, ac sollicitudin ante gravida ut. Suspendisse ut tempor risus. Donec hendrerit diam vestibulum, tincidunt magna eget, hendrerit dui. Etiam molestie fermentum massa ac pulvinar. Morbi aliquet tellus et volutpat dapibus. Vestibulum facilisis convallis euismod. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vestibulum eget ipsum eget lorem dapibus tristique quis convallis neque. Sed mollis interdum risus, non gravida ipsum tristique eget. Praesent vitae ligula quis neque varius eleifend in et elit. Nunc orci sapien, dapibus tincidunt tincidunt et, sollicitudin porttitor turpis. Ut lectus ante, imperdiet eu urna sed, aliquam malesuada est. Curabitur imperdiet eros accumsan tempor sollicitudin. Suspendisse ultricies erat vulputate feugiat hendrerit. Aenean placerat porttitor nunc, non iaculis erat cursus a. Sed eu congue mi. Mauris diam risus, iaculis sit amet neque ut, facilisis tincidunt sem. Nulla facilisi. Curabitur vestibulum diam mattis velit consequat, ut tempus leo lacinia. Proin consequat nisl vitae vestibulum viverra. Etiam vitae magna dignissim, malesuada ante vulputate, sagittis turpis. Nullam placerat nulla venenatis pretium adipiscing.'; $encoded = base64_encode_chunked($data); var_dump($encoded); function base64_encode_chunked ($data) { $result = ''; $length = strlen($data); $pos = 0; while ($pos < $length) { $inputChunk = substr($data, $pos, 234); // This must be divisible by 3 and 78. $encoded = base64_encode($inputChunk); $result .= chunk_split($encoded, 78, "\r\n"); $pos += 234; } return $result; }
Output for 4.3.0 - 4.3.10, 4.4.0 - 5.0.3, 5.0.5 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
string(3910) "TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNlY3RldHVyIGFkaXBpc2NpbmcgZWxpdC4gTW F1cmlzIHVybmEgc2VtLCBhbGlxdWV0IHBoYXJldHJhIGlwc3VtIHV0LCBwb3J0YSBldWlzbW9kIHR1 cnBpcy4gQ3JhcyByaG9uY3VzIHF1aXMgZmVsaXMgdGluY2lkdW50IGJpYmVuZHVtLiBDdXJhYml0dX Igdml0YWUgZW5pbSBuZWMgYXVndWUgdGVtcG9yIGNvbnNlcXVhdCBhIGlkIHZlbGl0LiBQcm9pbiBl Z2V0IHRvcnRvciBzYWdpdHRpcywgcHVsdmluYXIgdGVsbHVzIGVsZW1lbnR1bSwgdWx0cmljaWVzIG VuaW0uIER1aXMgYXVjdG9yIGp1c3RvIGluIHNlbSBncmF2aWRhIGxhY2luaWEuIFByYWV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