<?php
require __DIR__ . '/phpqrcode/qrlib.php';
$tmp = __DIR__ . '/temp/test_qr.png';
@unlink($tmp);
QRcode::png('upi://pay?pa=merchant@upi&pn=Test&am=1&tr=TEST123', $tmp, QR_ECLEVEL_L, 8);
if (file_exists($tmp)) {
    echo "OK: $tmp\n";
} else {
    echo "FAILED to create QR\n";
}