PHP code example of hamdallah90 / laravel-typephp
1. Go to this page and download the library: Download hamdallah90/laravel-typephp 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/ */
hamdallah90 / laravel-typephp example snippets
use App\Native\Fib;
Route::get('/fib/{n}', fn (int $n) => Fib::fib($n));
app/Native/Fib.php --tpc--> storage/typephp/app_native.so --extension=--> App\Native\Fib is an internal class
bash
php artisan typephp:make Fib # app/Native/Fib.php from a stub that follows the TypePHP rules
php artisan typephp:compile # storage/typephp/app_native.so
php artisan typephp:status # is it built? loaded? which classes run native?