getVersion()->getVersionNumber() . "\n"; echo "Size: " . $matrix->getSize() . "x" . $matrix->getSize() . "\n"; echo "Dark modules: " . $matrix->countDarkModules() . "\n\n"; // Generate SVG $svg = $generator->generateSvg($testUrl); echo "SVG length: " . strlen($svg) . " characters\n"; // Generate Data URI $dataUri = $generator->generateDataUri($testUrl); echo "Data URI length: " . strlen($dataUri) . " characters\n"; echo "Data URI prefix: " . substr($dataUri, 0, 50) . "...\n\n"; // Check matrix structure echo "Checking matrix structure:\n"; $size = $matrix->getSize(); // Check finder patterns $topLeft = $matrix->getModuleAt(0, 0)->isDark(); $topRight = $matrix->getModuleAt(0, $size - 1)->isDark(); $bottomLeft = $matrix->getModuleAt($size - 1, 0)->isDark(); echo "Top-left finder (0,0): " . ($topLeft ? "dark" : "light") . "\n"; echo "Top-right finder (0," . ($size - 1) . "): " . ($topRight ? "dark" : "light") . "\n"; echo "Bottom-left finder (" . ($size - 1) . ",0): " . ($bottomLeft ? "dark" : "light") . "\n"; // Check format information row echo "\nFormat information row (row 8):\n"; for ($col = 0; $col < min(15, $size); $col++) { $module = $matrix->getModuleAt(8, $col); echo $module->isDark() ? '█' : '░'; } echo "\n"; // Check format information column echo "Format information column (col 8, bottom 7):\n"; for ($row = $size - 7; $row < $size; $row++) { $module = $matrix->getModuleAt($row, 8); echo $module->isDark() ? '█' : '░'; } echo "\n"; // Save SVG to file for manual inspection $svgFile = __DIR__ . '/qrcode-test.svg'; file_put_contents($svgFile, $svg); echo "\nSVG saved to: {$svgFile}\n"; echo "You can open this file in a browser or QR code scanner to test.\n"; } catch (\Exception $e) { echo "ERROR: " . $e->getMessage() . "\n"; echo "Trace:\n" . $e->getTraceAsString() . "\n"; }