PHP code example of hmennen90 / php-vulkan

1. Go to this page and download the library: Download hmennen90/php-vulkan 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/ */

    

hmennen90 / php-vulkan example snippets



// Create Vulkan instance
$instance = new Vk\Instance(appName: 'MyApp');

// List GPUs
foreach ($instance->getPhysicalDevices() as $device) {
    echo $device->getName() . " (" . $device->getTypeName() . ")\n";
}
ini
extension=vulkan