PHP code example of aftermarketpl / php2js

1. Go to this page and download the library: Download aftermarketpl/php2js library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

aftermarketpl / php2js example snippets


function myFunc($param)
{
    return $param + 1;
}
$d = $a ? $b + myFunc($c) : $b ** $c;

$a = $$b;
$a = $b(); // May be supported in the future

$a = "string";
$b = $a[1]; // Use substr() instead

$array = array();
$a = $array + $array2;

$a = $b <=> $c; // May be supported in the future
$a = $b xor $c;
$a = $b ?: $c; // May be supported in the future
$a ??= $b;
$a **= $c;

$a = &$b;
function func(&$a) {}

continue 2;
break $a;

$a = strlen($b);
$a = substr($b, $c, 1);
$a = strtolower($b);